Rollup merge of #72045 - RalfJung:incomplete-unsound, r=petrochenkov

Incomplete features can also be unsound

Some incomplete features do not just ICE, they are also currently unsound (e.g. https://github.com/rust-lang/rust/pull/72029, and also `specialization` -- which is not yet marked incomplete but [should be](https://github.com/rust-lang/rust/pull/71420)). This makes the message reflect that.

While at it I also added a link to the tracking issue, which hopefully should explain what is incomplete/unsound about the feature.
This commit is contained in:
Ralf Jung 2020-05-16 19:46:29 +02:00 committed by GitHub
commit aecab5e603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
176 changed files with 284 additions and 182 deletions

View File

@ -28,8 +28,8 @@ use rustc_ast::visit::{FnCtxt, FnKind};
use rustc_ast_pretty::pprust::{self, expr_to_string};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_feature::Stability;
use rustc_feature::{deprecated_attributes, AttributeGate, AttributeTemplate, AttributeType};
use rustc_feature::{GateIssue, Stability};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::DefId;
@ -1817,13 +1817,21 @@ impl EarlyLintPass for IncompleteFeatures {
.map(|(name, span, _)| (name, span))
.chain(features.declared_lib_features.iter().map(|(name, span)| (name, span)))
.filter(|(name, _)| rustc_feature::INCOMPLETE_FEATURES.iter().any(|f| name == &f))
.for_each(|(name, &span)| {
.for_each(|(&name, &span)| {
cx.struct_span_lint(INCOMPLETE_FEATURES, span, |lint| {
lint.build(&format!(
"the feature `{}` is incomplete and may cause the compiler to crash",
let mut builder = lint.build(&format!(
"the feature `{}` is incomplete and may not be safe to use \
and/or cause compiler crashes",
name,
))
.emit()
));
if let Some(n) = rustc_feature::find_feature_issue(name, GateIssue::Language) {
builder.note(&format!(
"see issue #{} <https://github.com/rust-lang/rust/issues/{}> \
for more information",
n, n,
));
}
builder.emit();
})
});
}

View File

@ -1,6 +1,6 @@
// revisions:cfail1
#![feature(const_generics)]
//[cfail1]~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//[cfail1]~^ WARN the feature `const_generics` is incomplete
struct S<T, const N: usize>([T; N]);

View File

@ -1,6 +1,6 @@
// revisions:cfail1
#![feature(const_generics)]
//[cfail1]~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//[cfail1]~^ WARN the feature `const_generics` is incomplete
fn combinator<T, const S: usize>() -> [T; S] {}
//[cfail1]~^ ERROR mismatched types

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn is_123<const N: usize>(x: [u32; N]) -> bool {
match x {

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/match_arr_unknown_len.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0308]: mismatched types
--> $DIR/match_arr_unknown_len.rs:6:9

View File

@ -2,7 +2,7 @@
#![feature(associated_type_bounds)]
#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)] //~ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash [incomplete_features]
#![feature(impl_trait_in_bindings)] //~ WARN the feature `impl_trait_in_bindings` is incomplete
#![feature(untagged_unions)]
use std::iter;

View File

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/duplicate.rs:5:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:10:36

View File

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/dyn-lcsit.rs:4:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
warning: 1 warning emitted

View File

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/lcsit.rs:4:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
warning: 1 warning emitted

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0158]: const parameters cannot be referenced in patterns
--> $DIR/const-param.rs:7:9

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
trait Trait {}

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/apit-with-const-param.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Bad<const N: usize, T> { //~ ERROR type parameters must be declared prior
arr: [u8; { N }],

View File

@ -4,13 +4,14 @@ error: type parameters must be declared prior to const parameters
LL | struct Bad<const N: usize, T> {
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/argument_order.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: aborting due to previous error; 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#[allow(dead_code)]
struct ArithArrayLen<const N: usize>([u32; 0 + N]);

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/array-size-in-generic-struct-param.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: constant expression depends on a generic parameter
--> $DIR/array-size-in-generic-struct-param.rs:5:38

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#![allow(dead_code)]

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/array-wrapper-struct-ctor.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
pub trait Foo {
fn foo(&self);

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/broken-mir-1.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
use std::fmt::Debug;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/broken-mir-2.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> $DIR/broken-mir-2.rs:7:36

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn foo<const X: usize>() -> usize {
0

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/cannot-infer-const-args.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0282]: type annotations needed
--> $DIR/cannot-infer-const-args.rs:9:5

View File

@ -1,6 +1,6 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
// This test confirms that the types can be inferred correctly for this example with const
// generics. Previously this would ICE, and more recently error.

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/cannot-infer-type-for-const-param.rs:2:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -2,7 +2,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct A<const N: usize>; // ok

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/concrete-const-as-fn-arg.rs:4:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -3,7 +3,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
pub struct A<const N: u32>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/concrete-const-impl-method.rs:5:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
trait IsZeroTrait<const IS_ZERO: bool>{}

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/condition-in-trait-const-arg.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn const_u32_identity<const X: u32>() -> u32 {
X

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-arg-in-fn.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
type Array<T, const N: usize> = [T; N];

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-arg-type-arg-misordered.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0747]: constant provided when a type was expected
--> $DIR/const-arg-type-arg-misordered.rs:6:35

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn i32_identity<const X: i32>() -> i32 {
5

View File

@ -4,13 +4,14 @@ error: expected one of `,` or `>`, found `+`
LL | i32_identity::<1 + 2>();
| ^ expected one of `,` or `>`
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-expression-parameter.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: aborting due to previous error; 1 warning emitted

View File

@ -1,6 +1,6 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
const fn const_u32_identity<const X: u32>() -> u32 {
X

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-fn-with-const-param.rs:2:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Foo<T, const N: usize>([T; N]);

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-generic-array-wrapper.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#[derive(Debug)]
struct S<const N: usize>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-generic-type_name.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -4,7 +4,7 @@
// lifetimes within const/static items.
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct A<const N: &u8>;
//~^ ERROR `&` without an explicit lifetime name cannot be used here

View File

@ -28,13 +28,14 @@ error[E0637]: `&` without an explicit lifetime name cannot be used here
LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param-elided-lifetime.rs:6:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: aborting due to 5 previous errors; 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn foo<const X: u32>() {
fn bar() -> u32 {

View File

@ -8,13 +8,14 @@ LL | fn bar() -> u32 {
LL | X
| ^ use of generic parameter from outer function
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param-from-outer-fn.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: aborting due to previous error; 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
trait Trait<const T: ()> {}

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param-in-trait.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
// Currently, const parameters cannot depend on type parameters, because there is no way to
// enforce the structural-match property on an arbitrary type parameter. This restriction

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-param-type-depends-on-type-param.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0741]: `T` is not guaranteed to `#[derive(PartialEq, Eq)]`, so may not be used as the type of a const parameter
--> $DIR/const-param-type-depends-on-type-param.rs:9:34

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#![deny(non_upper_case_globals)]

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-parameter-uppercase-lint.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: const parameter `x` should have an upper case name
--> $DIR/const-parameter-uppercase-lint.rs:6:15

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#![allow(dead_code, unused_variables)]

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-types.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#[derive(Debug)]
struct X<const N: usize> {

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/derive-debug-array-wrapper.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> $DIR/derive-debug-array-wrapper.rs:6:5

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Const<const V: [usize; 1]> {}

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/different_byref.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0308]: mismatched types
--> $DIR/different_byref.rs:8:9

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics, const_compare_raw_pointers)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn function() -> u32 {
17

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/fn-const-param-call.rs:3:12
|
LL | #![feature(const_generics, const_compare_raw_pointers)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics, const_compare_raw_pointers)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Checked<const F: fn(usize) -> bool>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/fn-const-param-infer.rs:1:12
|
LL | #![feature(const_generics, const_compare_raw_pointers)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0308]: mismatched types
--> $DIR/fn-const-param-infer.rs:16:31

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
use std::fmt::Display;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/fn-taking-const-generic-array.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
#[derive(PartialEq, Eq)]
struct A;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/forbid-non-structural_match-types.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
--> $DIR/forbid-non-structural_match-types.rs:11:19

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
extern "C" {
fn foo<const X: usize>(); //~ ERROR foreign items may not have const parameters

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/foreign-item-const-parameter.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0044]: foreign items may not have const parameters
--> $DIR/foreign-item-const-parameter.rs:5:5

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct S<const X: u32>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/impl-const-generic-struct.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn foo<const X: usize, const Y: usize>() -> usize {
0

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/incorrect-number-of-const-args.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0107]: wrong number of const arguments: expected 2, found 1
--> $DIR/incorrect-number-of-const-args.rs:9:5

View File

@ -2,7 +2,7 @@
//
// see issue #70529
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct A<const N: usize> {
arr: [u8; N],

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/infer_arg_from_pat.rs:4:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -2,7 +2,7 @@
//
// see issue #70529
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn as_chunks<const N: usize>() -> [u8; N] {
loop {}

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/infer_arr_len_from_pat.rs:4:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn takes_closure_of_array_3<F>(f: F) where F: Fn([i32; 3]) {
f([1, 2, 3]);

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/integer-literal-generic-arg-in-where-clause.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
//~^ ERROR constant expression depends on a generic parameter

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61522-array-len-succ.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error: constant expression depends on a generic parameter
--> $DIR/issue-61522-array-len-succ.rs:4:40

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
trait Trait<const NAME: &'static str> {
type Assoc;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-66596-impl-trait-for-str-const-arg.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Generic<const V: usize>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-60818-struct-constructors.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
// build-pass

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61336-1.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
[x; { N }]

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61336-2.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/issue-61336-2.rs:9:5

View File

@ -1,5 +1,5 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
[x; N]

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61336.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/issue-61336.rs:9:5

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
use std::mem;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61422.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
fn promote<const N: i32>() {
// works:

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61432.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// check-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
struct Const<const N: usize>;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-61747.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: 1 warning emitted

View File

@ -1,7 +1,7 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
//~^ WARN the feature `const_generics` is incomplete
pub trait BitLen: Sized {
const BIT_LEN: usize;

View File

@ -1,10 +1,11 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-62187-encountered-polymorphic-const.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
warning: unused variable: `foo`
--> $DIR/issue-62187-encountered-polymorphic-const.rs:15:9

Some files were not shown because too many files have changed in this diff Show More