Skip to content

Commit d385310

Browse files
committed
Bring back the help message
1 parent c85acb9 commit d385310

12 files changed

+123
-6
lines changed

tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.stderr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ LL | fn owo_0<const N: &'static u32>() {}
1313
| ^^^^^^^^^^^^
1414
|
1515
= note: the only supported types are integers, `bool`, and `char`
16+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
17+
|
18+
LL + #![feature(adt_const_params)]
19+
|
20+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
21+
|
22+
LL + #![feature(unsized_const_params)]
23+
|
1624

1725
error: `Meow` is forbidden as the type of a const generic parameter
1826
--> $DIR/suggest_feature_only_when_possible.rs:18:20
@@ -33,6 +41,14 @@ LL | fn meow_1<const N: &'static Meow>() {}
3341
| ^^^^^^^^^^^^^
3442
|
3543
= note: the only supported types are integers, `bool`, and `char`
44+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
45+
|
46+
LL + #![feature(adt_const_params)]
47+
|
48+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
49+
|
50+
LL + #![feature(unsized_const_params)]
51+
|
3652

3753
error: `[Meow; 100]` is forbidden as the type of a const generic parameter
3854
--> $DIR/suggest_feature_only_when_possible.rs:22:20

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ LL | trait Trait<const S: &'static str> {}
1414
| ^^^^^^^^^^^^
1515
|
1616
= note: the only supported types are integers, `bool`, and `char`
17+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
18+
|
19+
LL + #![feature(adt_const_params)]
20+
|
21+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
22+
|
23+
LL + #![feature(unsized_const_params)]
24+
|
1725

1826
error: aborting due to 2 previous errors
1927

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | fn test<const T: &'static dyn A>() {
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: aborting due to 1 previous error
1018

tests/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | fn a<const X: &'static [u32]>() {}
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: aborting due to 1 previous error
1018

tests/ui/const-generics/min_const_generics/complex-types.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ LL | struct Faz<const N: &'static u8>;
4141
| ^^^^^^^^^^^
4242
|
4343
= note: the only supported types are integers, `bool`, and `char`
44+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
45+
|
46+
LL + #![feature(adt_const_params)]
47+
|
48+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
49+
|
50+
LL + #![feature(unsized_const_params)]
51+
|
4452

4553
error: `!` is forbidden as the type of a const generic parameter
4654
--> $DIR/complex-types.rs:17:21

tests/ui/const-generics/slice-const-param-mismatch.min.stderr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | struct ConstString<const T: &'static str>;
55
| ^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: `&'static [u8]` is forbidden as the type of a const generic parameter
1018
--> $DIR/slice-const-param-mismatch.rs:11:28
@@ -13,6 +21,14 @@ LL | struct ConstBytes<const T: &'static [u8]>;
1321
| ^^^^^^^^^^^^^
1422
|
1523
= note: the only supported types are integers, `bool`, and `char`
24+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
25+
|
26+
LL + #![feature(adt_const_params)]
27+
|
28+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
29+
|
30+
LL + #![feature(unsized_const_params)]
31+
|
1632

1733
error[E0308]: mismatched types
1834
--> $DIR/slice-const-param-mismatch.rs:17:35

tests/ui/const-generics/transmute-const-param-static-reference.min.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | struct Const<const P: &'static ()>;
55
| ^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: aborting due to 1 previous error
1018

tests/ui/const-generics/type-dependent/issue-71348.min.stderr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | trait Get<'a, const N: &'static str> {
55
| ^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: `&'static str` is forbidden as the type of a const generic parameter
1018
--> $DIR/issue-71348.rs:18:25
@@ -13,6 +21,14 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a <Self as Get<N>>::Ta
1321
| ^^^^^^^^^^^^
1422
|
1523
= note: the only supported types are integers, `bool`, and `char`
24+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
25+
|
26+
LL + #![feature(adt_const_params)]
27+
|
28+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
29+
|
30+
LL + #![feature(unsized_const_params)]
31+
|
1632

1733
error: aborting due to 2 previous errors
1834

tests/ui/feature-gates/feature-gate-adt_const_params.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ LL | struct Foo<const NAME: &'static str>;
55
| ^^^^^^^^^^^^
66
|
77
= note: the only supported types are integers, `bool`, and `char`
8+
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
9+
|
10+
LL + #![feature(adt_const_params)]
11+
|
12+
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
13+
|
14+
LL + #![feature(unsized_const_params)]
15+
|
816

917
error: aborting due to 1 previous error
1018

tests/ui/feature-gates/feature-gate-unsized-const-params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
struct Bar(u8);
44

55
struct Foo<const N: Bar>;
6-
//~^ ERROR: `[u8]` is forbidden as the type of a const generic parameter
6+
//~^ ERROR: `Bar` must implement `ConstParamTy` to be used as the type of a const generic parameter
77

88
fn main() {}

0 commit comments

Comments
 (0)