Skip to content

Commit 8fec6c7

Browse files
committed
Auto merge of #80714 - jakevossen5:master, r=lcnr
fixed const_generics error help Closes #80702
2 parents 9530fdc + 65f7dba commit 8fec6c7

29 files changed

+55
-55
lines changed

compiler/rustc_typeck/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
330330
),
331331
)
332332
.note("the only supported types are integers, `bool` and `char`")
333-
.help("more complex types are supported with `#[feature(const_generics)]`")
333+
.help("more complex types are supported with `#![feature(const_generics)]`")
334334
.emit()
335335
}
336336
};

src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | struct B<const CFG: Config> {
2323
| ^^^^^^
2424
|
2525
= note: the only supported types are integers, `bool` and `char`
26-
= help: more complex types are supported with `#[feature(const_generics)]`
26+
= help: more complex types are supported with `#![feature(const_generics)]`
2727

2828
error: aborting due to 3 previous errors
2929

src/test/ui/const-generics/const-param-before-other-params.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | fn bar<const X: (), 'a>(_: &'a ()) {
1717
| ^^
1818
|
1919
= note: the only supported types are integers, `bool` and `char`
20-
= help: more complex types are supported with `#[feature(const_generics)]`
20+
= help: more complex types are supported with `#![feature(const_generics)]`
2121

2222
error: `()` is forbidden as the type of a const generic parameter
2323
--> $DIR/const-param-before-other-params.rs:10:17
@@ -26,7 +26,7 @@ LL | fn foo<const X: (), T>(_: &T) {}
2626
| ^^
2727
|
2828
= note: the only supported types are integers, `bool` and `char`
29-
= help: more complex types are supported with `#[feature(const_generics)]`
29+
= help: more complex types are supported with `#![feature(const_generics)]`
3030

3131
error: aborting due to 4 previous errors
3232

src/test/ui/const-generics/const-param-elided-lifetime.min.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LL | struct A<const N: &u8>;
3535
| ^^^
3636
|
3737
= note: the only supported types are integers, `bool` and `char`
38-
= help: more complex types are supported with `#[feature(const_generics)]`
38+
= help: more complex types are supported with `#![feature(const_generics)]`
3939

4040
error: `&'static u8` is forbidden as the type of a const generic parameter
4141
--> $DIR/const-param-elided-lifetime.rs:15:15
@@ -44,7 +44,7 @@ LL | impl<const N: &u8> A<N> {
4444
| ^^^
4545
|
4646
= note: the only supported types are integers, `bool` and `char`
47-
= help: more complex types are supported with `#[feature(const_generics)]`
47+
= help: more complex types are supported with `#![feature(const_generics)]`
4848

4949
error: `&'static u8` is forbidden as the type of a const generic parameter
5050
--> $DIR/const-param-elided-lifetime.rs:23:15
@@ -53,7 +53,7 @@ LL | impl<const N: &u8> B for A<N> {}
5353
| ^^^
5454
|
5555
= note: the only supported types are integers, `bool` and `char`
56-
= help: more complex types are supported with `#[feature(const_generics)]`
56+
= help: more complex types are supported with `#![feature(const_generics)]`
5757

5858
error: `&'static u8` is forbidden as the type of a const generic parameter
5959
--> $DIR/const-param-elided-lifetime.rs:27:17
@@ -62,7 +62,7 @@ LL | fn bar<const N: &u8>() {}
6262
| ^^^
6363
|
6464
= note: the only supported types are integers, `bool` and `char`
65-
= help: more complex types are supported with `#[feature(const_generics)]`
65+
= help: more complex types are supported with `#![feature(const_generics)]`
6666

6767
error: `&'static u8` is forbidden as the type of a const generic parameter
6868
--> $DIR/const-param-elided-lifetime.rs:18:21
@@ -71,7 +71,7 @@ LL | fn foo<const M: &u8>(&self) {}
7171
| ^^^
7272
|
7373
= note: the only supported types are integers, `bool` and `char`
74-
= help: more complex types are supported with `#[feature(const_generics)]`
74+
= help: more complex types are supported with `#![feature(const_generics)]`
7575

7676
error: aborting due to 10 previous errors
7777

src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
1717
| ^^^^^^^
1818
|
1919
= note: the only supported types are integers, `bool` and `char`
20-
= help: more complex types are supported with `#[feature(const_generics)]`
20+
= help: more complex types are supported with `#![feature(const_generics)]`
2121

2222
error: `[u8; _]` is forbidden as the type of a const generic parameter
2323
--> $DIR/const-param-type-depends-on-const-param.rs:15:35
@@ -26,7 +26,7 @@ LL | pub struct SelfDependent<const N: [u8; N]>;
2626
| ^^^^^^^
2727
|
2828
= note: the only supported types are integers, `bool` and `char`
29-
= help: more complex types are supported with `#[feature(const_generics)]`
29+
= help: more complex types are supported with `#![feature(const_generics)]`
3030

3131
error: aborting due to 4 previous errors
3232

src/test/ui/const-generics/different_byref.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Const<const V: [usize; 1]> {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct B<const X: A>; // ok
55
| ^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: `C` is forbidden as the type of a const generic parameter
1111
--> $DIR/forbid-non-structural_match-types.rs:14:19
@@ -14,7 +14,7 @@ LL | struct D<const X: C>;
1414
| ^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
2020
--> $DIR/forbid-non-structural_match-types.rs:14:19

src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | trait Trait<const S: &'static str> {}
1414
| ^^^^^^^^^^^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/const-generics/issue-66596-impl-trait-for-str-const-arg.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | trait Trait<const NAME: &'static str> {
55
| ^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn foo<const T: NoMatch>() -> bool {
55
| ^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-62878.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | fn foo<const N: usize, const A: [u8; N]>() {}
1111
| ^^^^^^^
1212
|
1313
= note: the only supported types are integers, `bool` and `char`
14-
= help: more complex types are supported with `#[feature(const_generics)]`
14+
= help: more complex types are supported with `#![feature(const_generics)]`
1515

1616
error: aborting due to 2 previous errors
1717

src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn test<const T: &'static dyn A>() {
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
1111
--> $DIR/issue-63322-forbid-dyn.rs:9:18

src/test/ui/const-generics/issues/issue-68615-adt.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Const<const V: [usize; 0]> {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-68615-array.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<const V: [usize; 0] > {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-71169.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
1111
| ^^^^^^^^^
1212
|
1313
= note: the only supported types are integers, `bool` and `char`
14-
= help: more complex types are supported with `#[feature(const_generics)]`
14+
= help: more complex types are supported with `#![feature(const_generics)]`
1515

1616
error: aborting due to 2 previous errors
1717

src/test/ui/const-generics/issues/issue-73491.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn hoge<const IN: [u32; LEN]>() {}
55
| ^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-74101.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn test<const N: [u8; 1 + 2]>() {}
55
| ^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: `[u8; _]` is forbidden as the type of a const generic parameter
1111
--> $DIR/issue-74101.rs:9:21
@@ -14,7 +14,7 @@ LL | struct Foo<const N: [u8; 1 + 2]>;
1414
| ^^^^^^^^^^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/const-generics/issues/issue-74255.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn ice_struct_fn<const I: IceEnum>() {}
55
| ^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/issues/issue-74950.min.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Outer<const I: Inner>;
55
| ^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: `Inner` is forbidden as the type of a const generic parameter
1111
--> $DIR/issue-74950.rs:17:23
@@ -14,7 +14,7 @@ LL | struct Outer<const I: Inner>;
1414
| ^^^^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error: `Inner` is forbidden as the type of a const generic parameter
2020
--> $DIR/issue-74950.rs:17:23
@@ -23,7 +23,7 @@ LL | struct Outer<const I: Inner>;
2323
| ^^^^^
2424
|
2525
= note: the only supported types are integers, `bool` and `char`
26-
= help: more complex types are supported with `#[feature(const_generics)]`
26+
= help: more complex types are supported with `#![feature(const_generics)]`
2727

2828
error: `Inner` is forbidden as the type of a const generic parameter
2929
--> $DIR/issue-74950.rs:17:23
@@ -32,7 +32,7 @@ LL | struct Outer<const I: Inner>;
3232
| ^^^^^
3333
|
3434
= note: the only supported types are integers, `bool` and `char`
35-
= help: more complex types are supported with `#[feature(const_generics)]`
35+
= help: more complex types are supported with `#![feature(const_generics)]`
3636

3737
error: `Inner` is forbidden as the type of a const generic parameter
3838
--> $DIR/issue-74950.rs:17:23
@@ -41,7 +41,7 @@ LL | struct Outer<const I: Inner>;
4141
| ^^^^^
4242
|
4343
= note: the only supported types are integers, `bool` and `char`
44-
= help: more complex types are supported with `#[feature(const_generics)]`
44+
= help: more complex types are supported with `#![feature(const_generics)]`
4545

4646
error: aborting due to 5 previous errors
4747

src/test/ui/const-generics/issues/issue-75047.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<const N: [u8; Bar::<u32>::value()]>;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/min_const_generics/complex-types.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<const N: [u8; 0]>;
55
| ^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: `()` is forbidden as the type of a const generic parameter
1111
--> $DIR/complex-types.rs:6:21
@@ -14,7 +14,7 @@ LL | struct Bar<const N: ()>;
1414
| ^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error: `No` is forbidden as the type of a const generic parameter
2020
--> $DIR/complex-types.rs:11:21
@@ -23,7 +23,7 @@ LL | struct Fez<const N: No>;
2323
| ^^
2424
|
2525
= note: the only supported types are integers, `bool` and `char`
26-
= help: more complex types are supported with `#[feature(const_generics)]`
26+
= help: more complex types are supported with `#![feature(const_generics)]`
2727

2828
error: `&'static u8` is forbidden as the type of a const generic parameter
2929
--> $DIR/complex-types.rs:14:21
@@ -32,7 +32,7 @@ LL | struct Faz<const N: &'static u8>;
3232
| ^^^^^^^^^^^
3333
|
3434
= note: the only supported types are integers, `bool` and `char`
35-
= help: more complex types are supported with `#[feature(const_generics)]`
35+
= help: more complex types are supported with `#![feature(const_generics)]`
3636

3737
error: `!` is forbidden as the type of a const generic parameter
3838
--> $DIR/complex-types.rs:17:21
@@ -41,7 +41,7 @@ LL | struct Fiz<const N: !>;
4141
| ^
4242
|
4343
= note: the only supported types are integers, `bool` and `char`
44-
= help: more complex types are supported with `#[feature(const_generics)]`
44+
= help: more complex types are supported with `#![feature(const_generics)]`
4545

4646
error: `()` is forbidden as the type of a const generic parameter
4747
--> $DIR/complex-types.rs:20:19
@@ -50,7 +50,7 @@ LL | enum Goo<const N: ()> { A, B }
5050
| ^^
5151
|
5252
= note: the only supported types are integers, `bool` and `char`
53-
= help: more complex types are supported with `#[feature(const_generics)]`
53+
= help: more complex types are supported with `#![feature(const_generics)]`
5454

5555
error: `()` is forbidden as the type of a const generic parameter
5656
--> $DIR/complex-types.rs:23:20
@@ -59,7 +59,7 @@ LL | union Boo<const N: ()> { a: () }
5959
| ^^
6060
|
6161
= note: the only supported types are integers, `bool` and `char`
62-
= help: more complex types are supported with `#[feature(const_generics)]`
62+
= help: more complex types are supported with `#![feature(const_generics)]`
6363

6464
error: aborting due to 7 previous errors
6565

src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn a<const X: &'static [u32]>() {}
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Const<const P: &'static ()>;
55
| ^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/nested-type.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | | }]>;
1212
| |__^
1313
|
1414
= note: the only supported types are integers, `bool` and `char`
15-
= help: more complex types are supported with `#[feature(const_generics)]`
15+
= help: more complex types are supported with `#![feature(const_generics)]`
1616

1717
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
1818
--> $DIR/nested-type.rs:15:5

src/test/ui/const-generics/slice-const-param-mismatch.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct ConstString<const T: &'static str>;
55
| ^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool` and `char`
8-
= help: more complex types are supported with `#[feature(const_generics)]`
8+
= help: more complex types are supported with `#![feature(const_generics)]`
99

1010
error: `&'static [u8]` is forbidden as the type of a const generic parameter
1111
--> $DIR/slice-const-param-mismatch.rs:9:28
@@ -14,7 +14,7 @@ LL | struct ConstBytes<const T: &'static [u8]>;
1414
| ^^^^^^^^^^^^^
1515
|
1616
= note: the only supported types are integers, `bool` and `char`
17-
= help: more complex types are supported with `#[feature(const_generics)]`
17+
= help: more complex types are supported with `#![feature(const_generics)]`
1818

1919
error: aborting due to 2 previous errors
2020

0 commit comments

Comments
 (0)