From b7593e5070e71af5d43b29c84611a836b8d0fdcc Mon Sep 17 00:00:00 2001 From: mendess Date: Tue, 24 Nov 2020 09:35:08 +0000 Subject: [PATCH 1/3] Add note to use nightly when using expr in const generics --- compiler/rustc_resolve/src/diagnostics.rs | 1 + .../array-size-in-generic-struct-param.min.stderr | 2 ++ src/test/ui/const-generics/const-arg-in-const-arg.min.stderr | 4 ++++ .../feature-gate-const_evaluatable_checked.min.stderr | 1 + .../const_evaluatable_checked/simple.min.stderr | 2 ++ .../const_evaluatable_checked/simple_fail.min.stderr | 1 + .../generic-function-call-in-array-length.min.stderr | 2 ++ .../ui/const-generics/generic-sum-in-array-length.min.stderr | 2 ++ .../ui/const-generics/issue-61522-array-len-succ.min.stderr | 2 ++ src/test/ui/const-generics/issues/issue-61747.min.stderr | 1 + src/test/ui/const-generics/issues/issue-61935.min.stderr | 1 + src/test/ui/const-generics/issues/issue-62220.min.stderr | 1 + src/test/ui/const-generics/issues/issue-62456.min.stderr | 1 + src/test/ui/const-generics/issues/issue-66205.min.stderr | 1 + src/test/ui/const-generics/issues/issue-68366.min.stderr | 1 + src/test/ui/const-generics/issues/issue-68977.min.stderr | 2 ++ src/test/ui/const-generics/issues/issue-72787.min.stderr | 4 ++++ .../issues/issue-72819-generic-in-const-eval.min.stderr | 1 + .../issues/issue-76701-ty-param-in-const.min.stderr | 1 + src/test/ui/const-generics/macro_rules-braces.min.stderr | 4 ++++ .../min_const_generics/complex-expression.stderr | 4 ++++ src/test/ui/const-generics/wf-misc.min.stderr | 2 ++ 22 files changed, 41 insertions(+) diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 67491b5bf7e4e..70ab59970d8a7 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -480,6 +480,7 @@ impl<'a> Resolver<'a> { "const parameters may only be used as standalone arguments, i.e. `{}`", name )); + err.note("use feature(const_generics) and feature(const_evaluatable_checked) to enable this"); } err diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr index cfaacf7a5be33..ae3b593f9d314 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr @@ -5,6 +5,7 @@ LL | struct ArithArrayLen([u32; 0 + N]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/array-size-in-generic-struct-param.rs:20:15 @@ -13,6 +14,7 @@ LL | arr: [u8; CFG.arr_size], | ^^^ cannot perform const operation using `CFG` | = help: const parameters may only be used as standalone arguments, i.e. `CFG` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: `Config` is forbidden as the type of a const generic parameter --> $DIR/array-size-in-generic-struct-param.rs:18:21 diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr index 7dfe250b78e00..9e3c07558f1d6 100644 --- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr +++ b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr @@ -13,6 +13,7 @@ LL | let _: [u8; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:25:23 @@ -21,6 +22,7 @@ LL | let _ = [0; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:30:24 @@ -37,6 +39,7 @@ LL | let _: Foo<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:36:27 @@ -53,6 +56,7 @@ LL | let _ = Foo::<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:16:23 diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr index 359c2d2a22f02..8da75e953ff93 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr @@ -5,6 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr index 46485262cc46e..91438ee1f65c2 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr @@ -5,6 +5,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/simple.rs:8:35 @@ -13,6 +14,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr index 981d993f58976..dd2164ee45a45 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr @@ -5,6 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr index 84449018e4609..9d2524b60952a 100644 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr @@ -5,6 +5,7 @@ LL | fn bar() -> [u32; foo(N)] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/generic-function-call-in-array-length.rs:12:13 @@ -13,6 +14,7 @@ LL | [0; foo(N)] | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr index d3f7143327ead..5a0e72524fb28 100644 --- a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr @@ -5,6 +5,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `A` | = help: const parameters may only be used as standalone arguments, i.e. `A` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/generic-sum-in-array-length.rs:7:57 @@ -13,6 +14,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `B` | = help: const parameters may only be used as standalone arguments, i.e. `B` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr index 526807f0a2474..0ec673593d0b6 100644 --- a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr +++ b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr @@ -5,6 +5,7 @@ LL | pub struct MyArray([u8; COUNT + 1]); | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/issue-61522-array-len-succ.rs:12:30 @@ -13,6 +14,7 @@ LL | fn inner(&self) -> &[u8; COUNT + 1] { | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr index b176f9d1c75aa..1e4fdd885ec85 100644 --- a/src/test/ui/const-generics/issues/issue-61747.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61747.min.stderr @@ -5,6 +5,7 @@ LL | fn successor() -> Const<{C + 1}> { | ^ cannot perform const operation using `C` | = help: const parameters may only be used as standalone arguments, i.e. `C` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr index 9e31466259fd9..cf1ff180935ec 100644 --- a/src/test/ui/const-generics/issues/issue-61935.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61935.min.stderr @@ -5,6 +5,7 @@ LL | Self:FooImpl<{N==0}> | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr index 3bd127ee74a59..dd8fbfebd2f6b 100644 --- a/src/test/ui/const-generics/issues/issue-62220.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62220.min.stderr @@ -5,6 +5,7 @@ LL | pub type TruncatedVector = Vector; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr index c73f62a4a07d9..ac11191b119cd 100644 --- a/src/test/ui/const-generics/issues/issue-62456.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62456.min.stderr @@ -5,6 +5,7 @@ LL | let _ = [0u64; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr index 282f72be6da6e..f3e3eb6c5a65a 100644 --- a/src/test/ui/const-generics/issues/issue-66205.min.stderr +++ b/src/test/ui/const-generics/issues/issue-66205.min.stderr @@ -5,6 +5,7 @@ LL | fact::<{ N - 1 }>(); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr index b900a0d096ac2..7dcb3ea1acb05 100644 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr @@ -5,6 +5,7 @@ LL | impl Collatz<{Some(N)}> {} | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:12:13 diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr index 7828d85939497..67ca519de2c2c 100644 --- a/src/test/ui/const-generics/issues/issue-68977.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68977.min.stderr @@ -5,6 +5,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^ cannot perform const operation using `INT_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `INT_BITS` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/issue-68977.rs:29:28 @@ -13,6 +14,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^^ cannot perform const operation using `FRAC_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `FRAC_BITS` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr index d960d9513b752..2a7672d0c8926 100644 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72787.min.stderr @@ -5,6 +5,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `LHS` | = help: const parameters may only be used as standalone arguments, i.e. `LHS` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:11:24 @@ -13,6 +14,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `RHS` | = help: const parameters may only be used as standalone arguments, i.e. `RHS` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:25 @@ -21,6 +23,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `I` | = help: const parameters may only be used as standalone arguments, i.e. `I` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:36 @@ -29,6 +32,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `J` | = help: const parameters may only be used as standalone arguments, i.e. `J` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error[E0283]: type annotations needed --> $DIR/issue-72787.rs:22:26 diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr index 9fec3eb946d83..f7c4109e55290 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr @@ -5,6 +5,7 @@ LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue, | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr index c10db84ea6ecc..57514736121c6 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr @@ -13,6 +13,7 @@ LL | fn const_param() -> [u8; N + 1] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/macro_rules-braces.min.stderr b/src/test/ui/const-generics/macro_rules-braces.min.stderr index c6425edc10f15..b23053756d146 100644 --- a/src/test/ui/const-generics/macro_rules-braces.min.stderr +++ b/src/test/ui/const-generics/macro_rules-braces.min.stderr @@ -27,6 +27,7 @@ LL | let _: foo!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:41:19 @@ -35,6 +36,7 @@ LL | let _: bar!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:46:20 @@ -43,6 +45,7 @@ LL | let _: baz!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:51:19 @@ -51,6 +54,7 @@ LL | let _: biz!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr index a8de987e1675e..d8debd2b93048 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr @@ -5,6 +5,7 @@ LL | struct Break0([u8; { N + 1 }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:14:40 @@ -13,6 +14,7 @@ LL | struct Break1([u8; { { N } }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:18:17 @@ -21,6 +23,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:23:17 @@ -29,6 +32,7 @@ LL | let _ = [0; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:27:45 diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr index 935f12dd2c304..296b1c15cf017 100644 --- a/src/test/ui/const-generics/wf-misc.min.stderr +++ b/src/test/ui/const-generics/wf-misc.min.stderr @@ -5,6 +5,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: generic parameters may not be used in const operations --> $DIR/wf-misc.rs:17:21 @@ -13,6 +14,7 @@ LL | let _: Const::<{N + 1}>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` + = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this error: aborting due to 2 previous errors From af978e3b63dce24e81a9ebecde08c9116f871a4e Mon Sep 17 00:00:00 2001 From: mendess Date: Tue, 24 Nov 2020 10:28:18 +0000 Subject: [PATCH 2/3] Requested changes --- compiler/rustc_resolve/src/diagnostics.rs | 2 +- .../array-size-in-generic-struct-param.min.stderr | 4 ++-- .../const-generics/const-arg-in-const-arg.min.stderr | 11 +++++++---- .../const-argument-if-length.min.stderr | 1 + .../feature-gate-const_evaluatable_checked.min.stderr | 2 +- .../const_evaluatable_checked/simple.min.stderr | 4 ++-- .../const_evaluatable_checked/simple_fail.min.stderr | 2 +- .../generic-function-call-in-array-length.min.stderr | 4 ++-- .../generic-sum-in-array-length.min.stderr | 4 ++-- .../intrinsics-type_name-as-const-argument.min.stderr | 1 + .../issue-61522-array-len-succ.min.stderr | 4 ++-- src/test/ui/const-generics/issue-67375.min.stderr | 1 + src/test/ui/const-generics/issue-67945-1.min.stderr | 2 ++ src/test/ui/const-generics/issue-67945-2.min.stderr | 2 ++ .../ui/const-generics/issues/issue-61747.min.stderr | 2 +- .../ui/const-generics/issues/issue-61935.min.stderr | 2 +- .../ui/const-generics/issues/issue-62220.min.stderr | 2 +- .../ui/const-generics/issues/issue-62456.min.stderr | 2 +- .../ui/const-generics/issues/issue-64494.min.stderr | 2 ++ .../ui/const-generics/issues/issue-66205.min.stderr | 2 +- .../ui/const-generics/issues/issue-68366.min.stderr | 2 +- .../ui/const-generics/issues/issue-68977.min.stderr | 4 ++-- .../ui/const-generics/issues/issue-72787.min.stderr | 8 ++++---- .../issue-72819-generic-in-const-eval.min.stderr | 2 +- .../issues/issue-76701-ty-param-in-const.min.stderr | 3 ++- .../ui/const-generics/macro_rules-braces.min.stderr | 8 ++++---- .../min_const_generics/complex-expression.stderr | 11 +++++++---- .../min_const_generics/self-ty-in-const-1.stderr | 1 + .../params-in-ct-in-ty-param-lazy-norm.min.stderr | 1 + src/test/ui/const-generics/wf-misc.min.stderr | 4 ++-- 30 files changed, 59 insertions(+), 41 deletions(-) diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 70ab59970d8a7..9f3e8be0f7a35 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -480,8 +480,8 @@ impl<'a> Resolver<'a> { "const parameters may only be used as standalone arguments, i.e. `{}`", name )); - err.note("use feature(const_generics) and feature(const_evaluatable_checked) to enable this"); } + err.note("use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions"); err } diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr index ae3b593f9d314..59f458b35aac7 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr @@ -5,7 +5,7 @@ LL | struct ArithArrayLen([u32; 0 + N]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/array-size-in-generic-struct-param.rs:20:15 @@ -14,7 +14,7 @@ LL | arr: [u8; CFG.arr_size], | ^^^ cannot perform const operation using `CFG` | = help: const parameters may only be used as standalone arguments, i.e. `CFG` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: `Config` is forbidden as the type of a const generic parameter --> $DIR/array-size-in-generic-struct-param.rs:18:21 diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr index 9e3c07558f1d6..136a4ddf73599 100644 --- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr +++ b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr @@ -5,6 +5,7 @@ LL | let _: [u8; foo::()]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:15:23 @@ -13,7 +14,7 @@ LL | let _: [u8; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:25:23 @@ -22,7 +23,7 @@ LL | let _ = [0; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:30:24 @@ -31,6 +32,7 @@ LL | let _: Foo<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:31:24 @@ -39,7 +41,7 @@ LL | let _: Foo<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:36:27 @@ -48,6 +50,7 @@ LL | let _ = Foo::<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:37:27 @@ -56,7 +59,7 @@ LL | let _ = Foo::<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:16:23 diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr index bce701ade8651..d85586ea0b79a 100644 --- a/src/test/ui/const-generics/const-argument-if-length.min.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr @@ -5,6 +5,7 @@ LL | pad: [u8; is_zst::()], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/const-argument-if-length.rs:17:12 diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr index 8da75e953ff93..70b71c041f137 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr @@ -5,7 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr index 91438ee1f65c2..efee04598aba3 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr @@ -5,7 +5,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/simple.rs:8:35 @@ -14,7 +14,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr index dd2164ee45a45..99e45fdece2bb 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr @@ -5,7 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr index 9d2524b60952a..a42375289bcd9 100644 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr @@ -5,7 +5,7 @@ LL | fn bar() -> [u32; foo(N)] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/generic-function-call-in-array-length.rs:12:13 @@ -14,7 +14,7 @@ LL | [0; foo(N)] | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr index 5a0e72524fb28..5b393351d5e84 100644 --- a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr @@ -5,7 +5,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `A` | = help: const parameters may only be used as standalone arguments, i.e. `A` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/generic-sum-in-array-length.rs:7:57 @@ -14,7 +14,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `B` | = help: const parameters may only be used as standalone arguments, i.e. `B` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr index 20a8d9fdaab53..8f38a55b19b75 100644 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr @@ -5,6 +5,7 @@ LL | T: Trait<{std::intrinsics::type_name::()}> | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: `&'static str` is forbidden as the type of a const generic parameter --> $DIR/intrinsics-type_name-as-const-argument.rs:10:22 diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr index 0ec673593d0b6..94968a4913847 100644 --- a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr +++ b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr @@ -5,7 +5,7 @@ LL | pub struct MyArray([u8; COUNT + 1]); | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-61522-array-len-succ.rs:12:30 @@ -14,7 +14,7 @@ LL | fn inner(&self) -> &[u8; COUNT + 1] { | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issue-67375.min.stderr b/src/test/ui/const-generics/issue-67375.min.stderr index 3c344edbf1d15..f71618933b634 100644 --- a/src/test/ui/const-generics/issue-67375.min.stderr +++ b/src/test/ui/const-generics/issue-67375.min.stderr @@ -5,6 +5,7 @@ LL | inner: [(); { [|_: &T| {}; 0].len() }], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0392]: parameter `T` is never used --> $DIR/issue-67375.rs:7:12 diff --git a/src/test/ui/const-generics/issue-67945-1.min.stderr b/src/test/ui/const-generics/issue-67945-1.min.stderr index 804236c30bd81..946f8ca1abcd9 100644 --- a/src/test/ui/const-generics/issue-67945-1.min.stderr +++ b/src/test/ui/const-generics/issue-67945-1.min.stderr @@ -5,6 +5,7 @@ LL | let x: S = MaybeUninit::uninit(); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-67945-1.rs:17:45 @@ -13,6 +14,7 @@ LL | let b = &*(&x as *const _ as *const S); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-1.rs:11:12 diff --git a/src/test/ui/const-generics/issue-67945-2.min.stderr b/src/test/ui/const-generics/issue-67945-2.min.stderr index 2de942c1220cd..8e189f0c196bf 100644 --- a/src/test/ui/const-generics/issue-67945-2.min.stderr +++ b/src/test/ui/const-generics/issue-67945-2.min.stderr @@ -5,6 +5,7 @@ LL | let x: S = MaybeUninit::uninit(); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-67945-2.rs:15:45 @@ -13,6 +14,7 @@ LL | let b = &*(&x as *const _ as *const S); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-2.rs:9:12 diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr index 1e4fdd885ec85..cb14813d8cac9 100644 --- a/src/test/ui/const-generics/issues/issue-61747.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61747.min.stderr @@ -5,7 +5,7 @@ LL | fn successor() -> Const<{C + 1}> { | ^ cannot perform const operation using `C` | = help: const parameters may only be used as standalone arguments, i.e. `C` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr index cf1ff180935ec..91055949d8c0f 100644 --- a/src/test/ui/const-generics/issues/issue-61935.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61935.min.stderr @@ -5,7 +5,7 @@ LL | Self:FooImpl<{N==0}> | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr index dd8fbfebd2f6b..6d49a4dc6edba 100644 --- a/src/test/ui/const-generics/issues/issue-62220.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62220.min.stderr @@ -5,7 +5,7 @@ LL | pub type TruncatedVector = Vector; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr index ac11191b119cd..a26f2a6bf0279 100644 --- a/src/test/ui/const-generics/issues/issue-62456.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62456.min.stderr @@ -5,7 +5,7 @@ LL | let _ = [0u64; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr index 8b02fd108bd5b..ded781cab45ad 100644 --- a/src/test/ui/const-generics/issues/issue-64494.min.stderr +++ b/src/test/ui/const-generics/issues/issue-64494.min.stderr @@ -5,6 +5,7 @@ LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} | ^^^^^^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-64494.rs:19:38 @@ -13,6 +14,7 @@ LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} | ^^^^^^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0119]: conflicting implementations of trait `MyTrait`: --> $DIR/issue-64494.rs:19:1 diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr index f3e3eb6c5a65a..e3a6b7a5ab2e5 100644 --- a/src/test/ui/const-generics/issues/issue-66205.min.stderr +++ b/src/test/ui/const-generics/issues/issue-66205.min.stderr @@ -5,7 +5,7 @@ LL | fact::<{ N - 1 }>(); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr index 7dcb3ea1acb05..85ceace45d6eb 100644 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr @@ -5,7 +5,7 @@ LL | impl Collatz<{Some(N)}> {} | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:12:13 diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr index 67ca519de2c2c..133f68d16fdc4 100644 --- a/src/test/ui/const-generics/issues/issue-68977.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68977.min.stderr @@ -5,7 +5,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^ cannot perform const operation using `INT_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `INT_BITS` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-68977.rs:29:28 @@ -14,7 +14,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^^ cannot perform const operation using `FRAC_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `FRAC_BITS` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr index 2a7672d0c8926..2feeafc778a07 100644 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72787.min.stderr @@ -5,7 +5,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `LHS` | = help: const parameters may only be used as standalone arguments, i.e. `LHS` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:11:24 @@ -14,7 +14,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `RHS` | = help: const parameters may only be used as standalone arguments, i.e. `RHS` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:25 @@ -23,7 +23,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `I` | = help: const parameters may only be used as standalone arguments, i.e. `I` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:36 @@ -32,7 +32,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `J` | = help: const parameters may only be used as standalone arguments, i.e. `J` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error[E0283]: type annotations needed --> $DIR/issue-72787.rs:22:26 diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr index f7c4109e55290..ada74ecd6f230 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr @@ -5,7 +5,7 @@ LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue, | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr index 57514736121c6..5fb2768e8f0e9 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr @@ -5,6 +5,7 @@ LL | fn ty_param() -> [u8; std::mem::size_of::()] { | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-76701-ty-param-in-const.rs:12:42 @@ -13,7 +14,7 @@ LL | fn const_param() -> [u8; N + 1] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/macro_rules-braces.min.stderr b/src/test/ui/const-generics/macro_rules-braces.min.stderr index b23053756d146..c7f3ddcfe9e3c 100644 --- a/src/test/ui/const-generics/macro_rules-braces.min.stderr +++ b/src/test/ui/const-generics/macro_rules-braces.min.stderr @@ -27,7 +27,7 @@ LL | let _: foo!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:41:19 @@ -36,7 +36,7 @@ LL | let _: bar!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:46:20 @@ -45,7 +45,7 @@ LL | let _: baz!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:51:19 @@ -54,7 +54,7 @@ LL | let _: biz!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr index d8debd2b93048..54448c68529e6 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr @@ -5,7 +5,7 @@ LL | struct Break0([u8; { N + 1 }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:14:40 @@ -14,7 +14,7 @@ LL | struct Break1([u8; { { N } }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:18:17 @@ -23,7 +23,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:23:17 @@ -32,7 +32,7 @@ LL | let _ = [0; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:27:45 @@ -41,6 +41,7 @@ LL | struct BreakTy0(T, [u8; { size_of::<*mut T>() }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:30:47 @@ -49,6 +50,7 @@ LL | struct BreakTy1(T, [u8; { { size_of::<*mut T>() } }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:34:32 @@ -57,6 +59,7 @@ LL | let _: [u8; size_of::<*mut T>() + 1]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions warning: cannot use constants which depend on generic parameters in types --> $DIR/complex-expression.rs:39:17 diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr index 64da5e07df2f4..c52d9552b9001 100644 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr +++ b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr @@ -5,6 +5,7 @@ LL | fn t1() -> [u8; std::mem::size_of::()]; | ^^^^ cannot perform const operation using `Self` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic `Self` types are currently not permitted in anonymous constants --> $DIR/self-ty-in-const-1.rs:14:41 diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr index 39aa8087cec50..bfe748855d701 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr @@ -13,6 +13,7 @@ LL | struct Foo()]>(T, U); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: constant values inside of type parameter defaults must not depend on generic parameters --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:12:21 diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr index 296b1c15cf017..8b1cf944856d6 100644 --- a/src/test/ui/const-generics/wf-misc.min.stderr +++ b/src/test/ui/const-generics/wf-misc.min.stderr @@ -5,7 +5,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/wf-misc.rs:17:21 @@ -14,7 +14,7 @@ LL | let _: Const::<{N + 1}>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use feature(const_generics) and feature(const_evaluatable_checked) to enable this + = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions error: aborting due to 2 previous errors From 888055eb4cbd6136d7f7f5d32be98a477fbde749 Mon Sep 17 00:00:00 2001 From: mendess Date: Tue, 24 Nov 2020 11:05:55 +0000 Subject: [PATCH 3/3] Swap note for help --- compiler/rustc_resolve/src/diagnostics.rs | 2 +- compiler/rustc_typeck/src/check/wfcheck.rs | 2 +- .../array-size-in-generic-struct-param.min.stderr | 6 +++--- .../const-arg-in-const-arg.min.stderr | 14 +++++++------- .../const-argument-if-length.min.stderr | 2 +- .../const-param-before-other-params.min.stderr | 4 ++-- .../const-param-elided-lifetime.min.stderr | 10 +++++----- ...st-param-type-depends-on-const-param.min.stderr | 4 ++-- ...ature-gate-const_evaluatable_checked.min.stderr | 2 +- .../const_evaluatable_checked/simple.min.stderr | 4 ++-- .../simple_fail.min.stderr | 2 +- .../ui/const-generics/different_byref.min.stderr | 2 +- .../forbid-non-structural_match-types.min.stderr | 4 ++-- ...eneric-function-call-in-array-length.min.stderr | 4 ++-- .../generic-sum-in-array-length.min.stderr | 4 ++-- ...trinsics-type_name-as-const-argument.min.stderr | 4 ++-- .../issue-61522-array-len-succ.min.stderr | 4 ++-- ...e-66596-impl-trait-for-str-const-arg.min.stderr | 2 +- src/test/ui/const-generics/issue-67375.min.stderr | 2 +- .../ui/const-generics/issue-67945-1.min.stderr | 4 ++-- .../ui/const-generics/issue-67945-2.min.stderr | 4 ++-- .../const-generics/issues/issue-61747.min.stderr | 2 +- .../const-generics/issues/issue-61935.min.stderr | 2 +- .../const-generics/issues/issue-62220.min.stderr | 2 +- .../const-generics/issues/issue-62456.min.stderr | 2 +- .../issues/issue-62579-no-match.min.stderr | 2 +- .../const-generics/issues/issue-62878.min.stderr | 2 +- .../issues/issue-63322-forbid-dyn.min.stderr | 2 +- .../const-generics/issues/issue-64494.min.stderr | 4 ++-- .../const-generics/issues/issue-66205.min.stderr | 2 +- .../const-generics/issues/issue-68366.min.stderr | 2 +- .../issues/issue-68615-adt.min.stderr | 2 +- .../issues/issue-68615-array.min.stderr | 2 +- .../const-generics/issues/issue-68977.min.stderr | 4 ++-- .../const-generics/issues/issue-71169.min.stderr | 2 +- .../const-generics/issues/issue-72787.min.stderr | 8 ++++---- .../issue-72819-generic-in-const-eval.min.stderr | 2 +- .../const-generics/issues/issue-73491.min.stderr | 2 +- .../const-generics/issues/issue-74101.min.stderr | 4 ++-- .../const-generics/issues/issue-74255.min.stderr | 2 +- .../const-generics/issues/issue-74950.min.stderr | 10 +++++----- .../const-generics/issues/issue-75047.min.stderr | 2 +- .../issue-76701-ty-param-in-const.min.stderr | 4 ++-- .../const-generics/macro_rules-braces.min.stderr | 8 ++++---- .../min_const_generics/complex-expression.stderr | 14 +++++++------- .../min_const_generics/complex-types.stderr | 14 +++++++------- .../min_const_generics/self-ty-in-const-1.stderr | 2 +- .../static-reference-array-const-param.stderr | 2 +- .../transmute-const-param-static-reference.stderr | 2 +- src/test/ui/const-generics/nested-type.min.stderr | 2 +- .../params-in-ct-in-ty-param-lazy-norm.min.stderr | 2 +- .../slice-const-param-mismatch.min.stderr | 4 ++-- .../ui/const-generics/slice-const-param.min.stderr | 4 ++-- .../std/const-generics-range.min.stderr | 12 ++++++------ .../type-dependent/issue-71348.min.stderr | 4 ++-- src/test/ui/const-generics/wf-misc.min.stderr | 4 ++-- 56 files changed, 113 insertions(+), 113 deletions(-) diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 9f3e8be0f7a35..a0d5b61e8bd1b 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -481,7 +481,7 @@ impl<'a> Resolver<'a> { name )); } - err.note("use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions"); + err.help("use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions"); err } diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index 5dffe5107b581..aeca801a4ee00 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -329,7 +329,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) { ), ) .note("the only supported types are integers, `bool` and `char`") - .note("more complex types are supported with `#[feature(const_generics)]`") + .help("more complex types are supported with `#[feature(const_generics)]`") .emit() } }; diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr index 59f458b35aac7..73c9ea59c955b 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr @@ -5,7 +5,7 @@ LL | struct ArithArrayLen([u32; 0 + N]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/array-size-in-generic-struct-param.rs:20:15 @@ -14,7 +14,7 @@ LL | arr: [u8; CFG.arr_size], | ^^^ cannot perform const operation using `CFG` | = help: const parameters may only be used as standalone arguments, i.e. `CFG` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: `Config` is forbidden as the type of a const generic parameter --> $DIR/array-size-in-generic-struct-param.rs:18:21 @@ -23,7 +23,7 @@ LL | struct B { | ^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 3 previous errors diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr index 136a4ddf73599..042fa9ad958b1 100644 --- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr +++ b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr @@ -5,7 +5,7 @@ LL | let _: [u8; foo::()]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:15:23 @@ -14,7 +14,7 @@ LL | let _: [u8; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:25:23 @@ -23,7 +23,7 @@ LL | let _ = [0; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:30:24 @@ -32,7 +32,7 @@ LL | let _: Foo<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:31:24 @@ -41,7 +41,7 @@ LL | let _: Foo<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:36:27 @@ -50,7 +50,7 @@ LL | let _ = Foo::<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:37:27 @@ -59,7 +59,7 @@ LL | let _ = Foo::<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:16:23 diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr index d85586ea0b79a..8a1074392a5cb 100644 --- a/src/test/ui/const-generics/const-argument-if-length.min.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr @@ -5,7 +5,7 @@ LL | pad: [u8; is_zst::()], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/const-argument-if-length.rs:17:12 diff --git a/src/test/ui/const-generics/const-param-before-other-params.min.stderr b/src/test/ui/const-generics/const-param-before-other-params.min.stderr index c7e6d1be42161..354c6d0615f1b 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.min.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.min.stderr @@ -17,7 +17,7 @@ LL | fn bar(_: &'a ()) { | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/const-param-before-other-params.rs:11:17 @@ -26,7 +26,7 @@ LL | fn foo(_: &T) {} | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 4 previous errors diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr index 81dbaee0ec514..ed30182690a7a 100644 --- a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr +++ b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr @@ -35,7 +35,7 @@ LL | struct A; | ^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:16:15 @@ -44,7 +44,7 @@ LL | impl A { | ^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:24:15 @@ -53,7 +53,7 @@ LL | impl B for A {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:28:17 @@ -62,7 +62,7 @@ LL | fn bar() {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:19:21 @@ -71,7 +71,7 @@ LL | fn foo(&self) {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 10 previous errors diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr index b00a160787629..6b7a218ada5dd 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr +++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr @@ -17,7 +17,7 @@ LL | pub struct Dependent([(); N]); | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `[u8; _]` is forbidden as the type of a const generic parameter --> $DIR/const-param-type-depends-on-const-param.rs:16:35 @@ -26,7 +26,7 @@ LL | pub struct SelfDependent; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 4 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr index 70b71c041f137..573bc66b7c7e8 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr @@ -5,7 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr index efee04598aba3..d476a7eb6455c 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr @@ -5,7 +5,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/simple.rs:8:35 @@ -14,7 +14,7 @@ LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr index 99e45fdece2bb..bd81e0bc5a8cf 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr @@ -5,7 +5,7 @@ LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/different_byref.min.stderr b/src/test/ui/const-generics/different_byref.min.stderr index 050b28abe5088..e5b393ffe99eb 100644 --- a/src/test/ui/const-generics/different_byref.min.stderr +++ b/src/test/ui/const-generics/different_byref.min.stderr @@ -5,7 +5,7 @@ LL | struct Const {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr index 40d8f44cafc04..014200178b9ca 100644 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr +++ b/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr @@ -5,7 +5,7 @@ LL | struct B; // ok | ^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `C` is forbidden as the type of a const generic parameter --> $DIR/forbid-non-structural_match-types.rs:15:19 @@ -14,7 +14,7 @@ LL | struct D; | ^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` 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:15:19 diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr index a42375289bcd9..526f98fe8cd4f 100644 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr @@ -5,7 +5,7 @@ LL | fn bar() -> [u32; foo(N)] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/generic-function-call-in-array-length.rs:12:13 @@ -14,7 +14,7 @@ LL | [0; foo(N)] | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr index 5b393351d5e84..e531b612b5609 100644 --- a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr +++ b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr @@ -5,7 +5,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `A` | = help: const parameters may only be used as standalone arguments, i.e. `A` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/generic-sum-in-array-length.rs:7:57 @@ -14,7 +14,7 @@ LL | fn foo(bar: [usize; A + B]) {} | ^ cannot perform const operation using `B` | = help: const parameters may only be used as standalone arguments, i.e. `B` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr index 8f38a55b19b75..02467df193c39 100644 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr @@ -5,7 +5,7 @@ LL | T: Trait<{std::intrinsics::type_name::()}> | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: `&'static str` is forbidden as the type of a const generic parameter --> $DIR/intrinsics-type_name-as-const-argument.rs:10:22 @@ -14,7 +14,7 @@ LL | trait Trait {} | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr index 94968a4913847..2eaef95c23216 100644 --- a/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr +++ b/src/test/ui/const-generics/issue-61522-array-len-succ.min.stderr @@ -5,7 +5,7 @@ LL | pub struct MyArray([u8; COUNT + 1]); | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-61522-array-len-succ.rs:12:30 @@ -14,7 +14,7 @@ LL | fn inner(&self) -> &[u8; COUNT + 1] { | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr b/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr index 786ded3c2fe42..1c2e7e069a181 100644 --- a/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr +++ b/src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr @@ -5,7 +5,7 @@ LL | trait Trait { | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issue-67375.min.stderr b/src/test/ui/const-generics/issue-67375.min.stderr index f71618933b634..da96b5374a57d 100644 --- a/src/test/ui/const-generics/issue-67375.min.stderr +++ b/src/test/ui/const-generics/issue-67375.min.stderr @@ -5,7 +5,7 @@ LL | inner: [(); { [|_: &T| {}; 0].len() }], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0392]: parameter `T` is never used --> $DIR/issue-67375.rs:7:12 diff --git a/src/test/ui/const-generics/issue-67945-1.min.stderr b/src/test/ui/const-generics/issue-67945-1.min.stderr index 946f8ca1abcd9..8fea130baa57c 100644 --- a/src/test/ui/const-generics/issue-67945-1.min.stderr +++ b/src/test/ui/const-generics/issue-67945-1.min.stderr @@ -5,7 +5,7 @@ LL | let x: S = MaybeUninit::uninit(); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-67945-1.rs:17:45 @@ -14,7 +14,7 @@ LL | let b = &*(&x as *const _ as *const S); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-1.rs:11:12 diff --git a/src/test/ui/const-generics/issue-67945-2.min.stderr b/src/test/ui/const-generics/issue-67945-2.min.stderr index 8e189f0c196bf..50633772b75a9 100644 --- a/src/test/ui/const-generics/issue-67945-2.min.stderr +++ b/src/test/ui/const-generics/issue-67945-2.min.stderr @@ -5,7 +5,7 @@ LL | let x: S = MaybeUninit::uninit(); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-67945-2.rs:15:45 @@ -14,7 +14,7 @@ LL | let b = &*(&x as *const _ as *const S); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-2.rs:9:12 diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr index cb14813d8cac9..1de9e71b6eb00 100644 --- a/src/test/ui/const-generics/issues/issue-61747.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61747.min.stderr @@ -5,7 +5,7 @@ LL | fn successor() -> Const<{C + 1}> { | ^ cannot perform const operation using `C` | = help: const parameters may only be used as standalone arguments, i.e. `C` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr index 91055949d8c0f..b1d92056a544c 100644 --- a/src/test/ui/const-generics/issues/issue-61935.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61935.min.stderr @@ -5,7 +5,7 @@ LL | Self:FooImpl<{N==0}> | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr index 6d49a4dc6edba..b338cdb87e1e5 100644 --- a/src/test/ui/const-generics/issues/issue-62220.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62220.min.stderr @@ -5,7 +5,7 @@ LL | pub type TruncatedVector = Vector; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr index a26f2a6bf0279..a4b501a7bb109 100644 --- a/src/test/ui/const-generics/issues/issue-62456.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62456.min.stderr @@ -5,7 +5,7 @@ LL | let _ = [0u64; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr b/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr index 6903b20fad63c..5117e20d6266b 100644 --- a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr @@ -5,7 +5,7 @@ LL | fn foo() -> bool { | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-62878.min.stderr b/src/test/ui/const-generics/issues/issue-62878.min.stderr index 34edd09b51565..9f95e5d88623e 100644 --- a/src/test/ui/const-generics/issues/issue-62878.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62878.min.stderr @@ -11,7 +11,7 @@ LL | fn foo() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr index e6d9fb7a24683..5dbfdc6d652b6 100644 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr +++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr @@ -5,7 +5,7 @@ LL | fn test() { | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter --> $DIR/issue-63322-forbid-dyn.rs:10:18 diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr index ded781cab45ad..681166b1d2b94 100644 --- a/src/test/ui/const-generics/issues/issue-64494.min.stderr +++ b/src/test/ui/const-generics/issues/issue-64494.min.stderr @@ -5,7 +5,7 @@ LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} | ^^^^^^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-64494.rs:19:38 @@ -14,7 +14,7 @@ LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} | ^^^^^^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0119]: conflicting implementations of trait `MyTrait`: --> $DIR/issue-64494.rs:19:1 diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr index e3a6b7a5ab2e5..ecd96ac37e404 100644 --- a/src/test/ui/const-generics/issues/issue-66205.min.stderr +++ b/src/test/ui/const-generics/issues/issue-66205.min.stderr @@ -5,7 +5,7 @@ LL | fact::<{ N - 1 }>(); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr index 85ceace45d6eb..acaf4a33ee0a8 100644 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr @@ -5,7 +5,7 @@ LL | impl Collatz<{Some(N)}> {} | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:12:13 diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr index 81c8f4392c735..59653114a6b61 100644 --- a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr @@ -5,7 +5,7 @@ LL | struct Const {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr index 8f55a92fce9af..1ee881b96ec60 100644 --- a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr @@ -5,7 +5,7 @@ LL | struct Foo {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr index 133f68d16fdc4..ea91df1e0bf4d 100644 --- a/src/test/ui/const-generics/issues/issue-68977.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68977.min.stderr @@ -5,7 +5,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^ cannot perform const operation using `INT_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `INT_BITS` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-68977.rs:29:28 @@ -14,7 +14,7 @@ LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; | ^^^^^^^^^ cannot perform const operation using `FRAC_BITS` | = help: const parameters may only be used as standalone arguments, i.e. `FRAC_BITS` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-71169.min.stderr b/src/test/ui/const-generics/issues/issue-71169.min.stderr index 79d63443351ff..9b0a2946ca6cf 100644 --- a/src/test/ui/const-generics/issues/issue-71169.min.stderr +++ b/src/test/ui/const-generics/issues/issue-71169.min.stderr @@ -11,7 +11,7 @@ LL | fn foo() {} | ^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr index 2feeafc778a07..27bbc28011f2e 100644 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72787.min.stderr @@ -5,7 +5,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `LHS` | = help: const parameters may only be used as standalone arguments, i.e. `LHS` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:11:24 @@ -14,7 +14,7 @@ LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `RHS` | = help: const parameters may only be used as standalone arguments, i.e. `RHS` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:25 @@ -23,7 +23,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `I` | = help: const parameters may only be used as standalone arguments, i.e. `I` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:26:36 @@ -32,7 +32,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `J` | = help: const parameters may only be used as standalone arguments, i.e. `J` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error[E0283]: type annotations needed --> $DIR/issue-72787.rs:22:26 diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr index ada74ecd6f230..2394b23d7995b 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr @@ -5,7 +5,7 @@ LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue, | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-73491.min.stderr b/src/test/ui/const-generics/issues/issue-73491.min.stderr index 5bf3671d38be3..3ff0563acc77d 100644 --- a/src/test/ui/const-generics/issues/issue-73491.min.stderr +++ b/src/test/ui/const-generics/issues/issue-73491.min.stderr @@ -5,7 +5,7 @@ LL | fn hoge() {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-74101.min.stderr b/src/test/ui/const-generics/issues/issue-74101.min.stderr index 8062faefbe60b..1351246667e9b 100644 --- a/src/test/ui/const-generics/issues/issue-74101.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74101.min.stderr @@ -5,7 +5,7 @@ LL | fn test() {} | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `[u8; _]` is forbidden as the type of a const generic parameter --> $DIR/issue-74101.rs:10:21 @@ -14,7 +14,7 @@ LL | struct Foo; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-74255.min.stderr b/src/test/ui/const-generics/issues/issue-74255.min.stderr index 86937d715c973..e3e8502ae6349 100644 --- a/src/test/ui/const-generics/issues/issue-74255.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74255.min.stderr @@ -5,7 +5,7 @@ LL | fn ice_struct_fn() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-74950.min.stderr b/src/test/ui/const-generics/issues/issue-74950.min.stderr index f093e6651bc28..12947a2ab3758 100644 --- a/src/test/ui/const-generics/issues/issue-74950.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74950.min.stderr @@ -5,7 +5,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:18:23 @@ -14,7 +14,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:18:23 @@ -23,7 +23,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:18:23 @@ -32,7 +32,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:18:23 @@ -41,7 +41,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 5 previous errors diff --git a/src/test/ui/const-generics/issues/issue-75047.min.stderr b/src/test/ui/const-generics/issues/issue-75047.min.stderr index edc54b082dbcb..b87bb18a5a683 100644 --- a/src/test/ui/const-generics/issues/issue-75047.min.stderr +++ b/src/test/ui/const-generics/issues/issue-75047.min.stderr @@ -5,7 +5,7 @@ LL | struct Foo::value()]>; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr index 5fb2768e8f0e9..551b8e43e1d4c 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr @@ -5,7 +5,7 @@ LL | fn ty_param() -> [u8; std::mem::size_of::()] { | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-76701-ty-param-in-const.rs:12:42 @@ -14,7 +14,7 @@ LL | fn const_param() -> [u8; N + 1] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/macro_rules-braces.min.stderr b/src/test/ui/const-generics/macro_rules-braces.min.stderr index c7f3ddcfe9e3c..c400e2c814dd7 100644 --- a/src/test/ui/const-generics/macro_rules-braces.min.stderr +++ b/src/test/ui/const-generics/macro_rules-braces.min.stderr @@ -27,7 +27,7 @@ LL | let _: foo!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:41:19 @@ -36,7 +36,7 @@ LL | let _: bar!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:46:20 @@ -45,7 +45,7 @@ LL | let _: baz!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/macro_rules-braces.rs:51:19 @@ -54,7 +54,7 @@ LL | let _: biz!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr index 54448c68529e6..2ea66279d4608 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr @@ -5,7 +5,7 @@ LL | struct Break0([u8; { N + 1 }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:14:40 @@ -14,7 +14,7 @@ LL | struct Break1([u8; { { N } }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:18:17 @@ -23,7 +23,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:23:17 @@ -32,7 +32,7 @@ LL | let _ = [0; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:27:45 @@ -41,7 +41,7 @@ LL | struct BreakTy0(T, [u8; { size_of::<*mut T>() }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:30:47 @@ -50,7 +50,7 @@ LL | struct BreakTy1(T, [u8; { { size_of::<*mut T>() } }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:34:32 @@ -59,7 +59,7 @@ LL | let _: [u8; size_of::<*mut T>() + 1]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions warning: cannot use constants which depend on generic parameters in types --> $DIR/complex-expression.rs:39:17 diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.stderr b/src/test/ui/const-generics/min_const_generics/complex-types.stderr index 52ed3c1c6ee8c..5d473f1f8769f 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-types.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-types.stderr @@ -5,7 +5,7 @@ LL | struct Foo; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:7:21 @@ -14,7 +14,7 @@ LL | struct Bar; | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `No` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:12:21 @@ -23,7 +23,7 @@ LL | struct Fez; | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:15:21 @@ -32,7 +32,7 @@ LL | struct Faz; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `!` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:18:21 @@ -41,7 +41,7 @@ LL | struct Fiz; | ^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:21:19 @@ -50,7 +50,7 @@ LL | enum Goo { A, B } | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:24:20 @@ -59,7 +59,7 @@ LL | union Boo { a: () } | ^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 7 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr index c52d9552b9001..40c73f0b95136 100644 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr +++ b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr @@ -5,7 +5,7 @@ LL | fn t1() -> [u8; std::mem::size_of::()]; | ^^^^ cannot perform const operation using `Self` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic `Self` types are currently not permitted in anonymous constants --> $DIR/self-ty-in-const-1.rs:14:41 diff --git a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr index cc32d8a67fed0..6c39f6b4c1dc3 100644 --- a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr +++ b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr @@ -5,7 +5,7 @@ LL | fn a() {} | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr index 063120ad074a0..6b90329b72cee 100644 --- a/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr +++ b/src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr @@ -5,7 +5,7 @@ LL | struct Const; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/nested-type.min.stderr b/src/test/ui/const-generics/nested-type.min.stderr index 4f76ec6e02b22..369e387508e9f 100644 --- a/src/test/ui/const-generics/nested-type.min.stderr +++ b/src/test/ui/const-generics/nested-type.min.stderr @@ -12,7 +12,7 @@ LL | | }]>; | |__^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants --> $DIR/nested-type.rs:16:5 diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr index bfe748855d701..9e0837a0a620c 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr @@ -13,7 +13,7 @@ LL | struct Foo()]>(T, U); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: constant values inside of type parameter defaults must not depend on generic parameters --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:12:21 diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr index 1f711bef4aa63..46997fed770ac 100644 --- a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr +++ b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr @@ -5,7 +5,7 @@ LL | struct ConstString; | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static [u8]` is forbidden as the type of a const generic parameter --> $DIR/slice-const-param-mismatch.rs:10:28 @@ -14,7 +14,7 @@ LL | struct ConstBytes; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/slice-const-param.min.stderr b/src/test/ui/const-generics/slice-const-param.min.stderr index 2a49619e6614a..7a9f65233e793 100644 --- a/src/test/ui/const-generics/slice-const-param.min.stderr +++ b/src/test/ui/const-generics/slice-const-param.min.stderr @@ -5,7 +5,7 @@ LL | pub fn function_with_str() -> &'static str { | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static [u8]` is forbidden as the type of a const generic parameter --> $DIR/slice-const-param.rs:13:41 @@ -14,7 +14,7 @@ LL | pub fn function_with_bytes() -> &'static [u8] { | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr index 97be6ee64457d..9274ccd2b921a 100644 --- a/src/test/ui/const-generics/std/const-generics-range.min.stderr +++ b/src/test/ui/const-generics/std/const-generics-range.min.stderr @@ -5,7 +5,7 @@ LL | struct _Range>; | ^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `RangeFrom` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:13:28 @@ -14,7 +14,7 @@ LL | struct _RangeFrom>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `RangeFull` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:18:28 @@ -23,7 +23,7 @@ LL | struct _RangeFull; | ^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `RangeInclusive` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:24:33 @@ -32,7 +32,7 @@ LL | struct _RangeInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `RangeTo` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:29:26 @@ -41,7 +41,7 @@ LL | struct _RangeTo>; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `RangeToInclusive` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:34:35 @@ -50,7 +50,7 @@ LL | struct _RangeToInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr index 8656239605dfd..8f240f0d930a4 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr +++ b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr @@ -5,7 +5,7 @@ LL | trait Get<'a, const N: &'static str> { | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: `&'static str` is forbidden as the type of a const generic parameter --> $DIR/issue-71348.rs:19:25 @@ -14,7 +14,7 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a >::Ta | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = note: more complex types are supported with `#[feature(const_generics)]` + = help: more complex types are supported with `#[feature(const_generics)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr index 8b1cf944856d6..99142cb6ce7a5 100644 --- a/src/test/ui/const-generics/wf-misc.min.stderr +++ b/src/test/ui/const-generics/wf-misc.min.stderr @@ -5,7 +5,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/wf-misc.rs:17:21 @@ -14,7 +14,7 @@ LL | let _: Const::<{N + 1}>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions + = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions error: aborting due to 2 previous errors