From f37e7375355d64163b26b10359ca7bc0d5fbe384 Mon Sep 17 00:00:00 2001 From: Jake Vossen Date: Mon, 4 Jan 2021 22:35:44 -0700 Subject: [PATCH 1/2] fixed const_generics error help --- compiler/rustc_typeck/src/check/wfcheck.rs | 2 +- .../array-size-in-generic-struct-param.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 ++-- .../ui/const-generics/different_byref.min.stderr | 2 +- .../forbid-non-structural_match-types.min.stderr | 4 ++-- ...trinsics-type_name-as-const-argument.min.stderr | 2 +- ...e-66596-impl-trait-for-str-const-arg.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 +- .../issues/issue-68615-adt.min.stderr | 2 +- .../issues/issue-68615-array.min.stderr | 2 +- .../const-generics/issues/issue-71169.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 +- .../min_const_generics/complex-types.stderr | 14 +++++++------- .../static-reference-array-const-param.stderr | 2 +- .../transmute-const-param-static-reference.stderr | 2 +- src/test/ui/const-generics/nested-type.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 ++-- 28 files changed, 54 insertions(+), 54 deletions(-) diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index ab41ff372e23f..d81d83f60bd13 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -330,7 +330,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) { ), ) .note("the only supported types are integers, `bool` and `char`") - .help("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 7af23103ce70f..8f6e56826fa1c 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 @@ -23,7 +23,7 @@ LL | struct B { | ^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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-param-before-other-params.min.stderr b/src/test/ui/const-generics/const-param-before-other-params.min.stderr index 1e49588f1b4e9..a9349ce43c94e 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` - = help: 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:10:17 @@ -26,7 +26,7 @@ LL | fn foo(_: &T) {} | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 5d3c8f7b2e613..48d33a785aead 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` - = help: 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:15:15 @@ -44,7 +44,7 @@ LL | impl A { | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:23:15 @@ -53,7 +53,7 @@ LL | impl B for A {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:27:17 @@ -62,7 +62,7 @@ LL | fn bar() {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:18:21 @@ -71,7 +71,7 @@ LL | fn foo(&self) {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 d63bc23632096..9804363f39a94 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` - = help: 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:15:35 @@ -26,7 +26,7 @@ LL | pub struct SelfDependent; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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/different_byref.min.stderr b/src/test/ui/const-generics/different_byref.min.stderr index 05720d15404ff..93874fb1f5fef 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` - = help: 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 3912cf577512c..80eac994d55c9 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` - = help: 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:14:19 @@ -14,7 +14,7 @@ LL | struct D; | ^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:14:19 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 4c2aaef349390..8701d54f5c963 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 @@ -14,7 +14,7 @@ LL | trait Trait {} | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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-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 b6c6e6fe37404..e96b9e7035264 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` - = help: 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-62579-no-match.min.stderr b/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr index a0aee4821c69e..5c9387d4012db 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` - = help: 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 920d7e43b9b7e..e4a71fe061869 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` - = help: 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 543e4b29a1620..2fb38addb2d81 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` - = help: 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:9:18 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 2de8ada276610..4782b1d98eba3 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` - = help: 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 0d17b04a5cdd9..d0c190b91b040 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` - = help: 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-71169.min.stderr b/src/test/ui/const-generics/issues/issue-71169.min.stderr index 68ac47460b359..1c6e08adffdff 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` - = help: 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-73491.min.stderr b/src/test/ui/const-generics/issues/issue-73491.min.stderr index aeab9e267728f..c8f2e0dadc1a7 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` - = help: 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 6561183f7cad4..a7f0ecf0a2692 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` - = help: 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:9:21 @@ -14,7 +14,7 @@ LL | struct Foo; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 2b6aa7dad97ee..62ad43974f4d8 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` - = help: 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 27393d38c6b1c..4e640ff857eae 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` - = help: 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:17:23 @@ -14,7 +14,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:17:23 @@ -23,7 +23,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:17:23 @@ -32,7 +32,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:17:23 @@ -41,7 +41,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 4ab90dd1ec669..3c1c3ea97b540 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` - = help: 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/complex-types.stderr b/src/test/ui/const-generics/min_const_generics/complex-types.stderr index 20d498f9c93be..a658a7b395689 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` - = help: 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:6:21 @@ -14,7 +14,7 @@ LL | struct Bar; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:11:21 @@ -23,7 +23,7 @@ LL | struct Fez; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:14:21 @@ -32,7 +32,7 @@ LL | struct Faz; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:17:21 @@ -41,7 +41,7 @@ LL | struct Fiz; | ^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:20:19 @@ -50,7 +50,7 @@ LL | enum Goo { A, B } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:23:20 @@ -59,7 +59,7 @@ LL | union Boo { a: () } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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/static-reference-array-const-param.stderr b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr index 05939b05bba3d..647ef5400cb29 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` - = help: 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 8724c7e33b1cc..d612e0c35a10f 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` - = help: 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 dabb3f245f5b2..6defd393ba068 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` - = help: 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:15:5 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 13d0b217ed298..166a35ee4556e 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` - = help: 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:9:28 @@ -14,7 +14,7 @@ LL | struct ConstBytes; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 821c6e3995aa3..ed39a0c56b48d 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` - = help: 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:12:41 @@ -14,7 +14,7 @@ LL | pub fn function_with_bytes() -> &'static [u8] { | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 d7d2a8447e902..86e6159fdb577 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` - = help: 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:12:28 @@ -14,7 +14,7 @@ LL | struct _RangeFrom>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:17:28 @@ -23,7 +23,7 @@ LL | struct _RangeFull; | ^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:23:33 @@ -32,7 +32,7 @@ LL | struct _RangeInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:28:26 @@ -41,7 +41,7 @@ LL | struct _RangeTo>; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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:33:35 @@ -50,7 +50,7 @@ LL | struct _RangeToInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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 92f5d815a0fe8..f3516d1de96bf 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` - = help: 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:18: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` - = help: 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 From 65f7dba622f082e1ea246866a1c85248e171e25f Mon Sep 17 00:00:00 2001 From: Jake Vossen Date: Tue, 5 Jan 2021 00:02:39 -0700 Subject: [PATCH 2/2] fixed feature gate stderr --- src/test/ui/feature-gates/feature-gate-const_generics.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.stderr b/src/test/ui/feature-gates/feature-gate-const_generics.stderr index b2b7e4576bf7d..ed19109b38b41 100644 --- a/src/test/ui/feature-gates/feature-gate-const_generics.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_generics.stderr @@ -5,7 +5,7 @@ LL | fn foo() {} | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: 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