Skip to content

Commit 888055e

Browse files
committed
Swap note for help
1 parent af978e3 commit 888055e

File tree

56 files changed

+113
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+113
-113
lines changed

compiler/rustc_resolve/src/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<'a> Resolver<'a> {
481481
name
482482
));
483483
}
484-
err.note("use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions");
484+
err.help("use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions");
485485

486486
err
487487
}

compiler/rustc_typeck/src/check/wfcheck.rs

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

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
55
| ^ cannot perform const operation using `N`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `N`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/array-size-in-generic-struct-param.rs:20:15
@@ -14,7 +14,7 @@ LL | arr: [u8; CFG.arr_size],
1414
| ^^^ cannot perform const operation using `CFG`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `CFG`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: `Config` is forbidden as the type of a const generic parameter
2020
--> $DIR/array-size-in-generic-struct-param.rs:18:21
@@ -23,7 +23,7 @@ LL | struct B<const CFG: Config> {
2323
| ^^^^^^
2424
|
2525
= note: the only supported types are integers, `bool` and `char`
26-
= note: 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-arg-in-const-arg.min.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _: [u8; foo::<T>()];
55
| ^ cannot perform const operation using `T`
66
|
77
= note: type parameters may not be used in const expressions
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/const-arg-in-const-arg.rs:15:23
@@ -14,7 +14,7 @@ LL | let _: [u8; bar::<N>()];
1414
| ^ cannot perform const operation using `N`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `N`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: generic parameters may not be used in const operations
2020
--> $DIR/const-arg-in-const-arg.rs:25:23
@@ -23,7 +23,7 @@ LL | let _ = [0; bar::<N>()];
2323
| ^ cannot perform const operation using `N`
2424
|
2525
= help: const parameters may only be used as standalone arguments, i.e. `N`
26-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
26+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
2727

2828
error: generic parameters may not be used in const operations
2929
--> $DIR/const-arg-in-const-arg.rs:30:24
@@ -32,7 +32,7 @@ LL | let _: Foo<{ foo::<T>() }>;
3232
| ^ cannot perform const operation using `T`
3333
|
3434
= note: type parameters may not be used in const expressions
35-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
35+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
3636

3737
error: generic parameters may not be used in const operations
3838
--> $DIR/const-arg-in-const-arg.rs:31:24
@@ -41,7 +41,7 @@ LL | let _: Foo<{ bar::<N>() }>;
4141
| ^ cannot perform const operation using `N`
4242
|
4343
= help: const parameters may only be used as standalone arguments, i.e. `N`
44-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
44+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
4545

4646
error: generic parameters may not be used in const operations
4747
--> $DIR/const-arg-in-const-arg.rs:36:27
@@ -50,7 +50,7 @@ LL | let _ = Foo::<{ foo::<T>() }>;
5050
| ^ cannot perform const operation using `T`
5151
|
5252
= note: type parameters may not be used in const expressions
53-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
53+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
5454

5555
error: generic parameters may not be used in const operations
5656
--> $DIR/const-arg-in-const-arg.rs:37:27
@@ -59,7 +59,7 @@ LL | let _ = Foo::<{ bar::<N>() }>;
5959
| ^ cannot perform const operation using `N`
6060
|
6161
= help: const parameters may only be used as standalone arguments, i.e. `N`
62-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
62+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
6363

6464
error[E0658]: a non-static lifetime is not allowed in a `const`
6565
--> $DIR/const-arg-in-const-arg.rs:16:23

src/test/ui/const-generics/const-argument-if-length.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pad: [u8; is_zst::<T>()],
55
| ^ cannot perform const operation using `T`
66
|
77
= note: type parameters may not be used in const expressions
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error[E0277]: the size for values of type `T` cannot be known at compilation time
1111
--> $DIR/const-argument-if-length.rs:17:12

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-
= note: 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:11: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-
= note: 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-
= note: 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:16: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-
= note: 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:24: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-
= note: 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:28: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-
= note: 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:19: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-
= note: 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-
= note: 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:16: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-
= note: 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_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Arr<const N: usize> = [u8; N - 1];
55
| ^ cannot perform const operation using `N`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `N`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: aborting due to previous error
1111

src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
55
| ^ cannot perform const operation using `N`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `N`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/simple.rs:8:35
@@ -14,7 +14,7 @@ LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
1414
| ^ cannot perform const operation using `N`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `N`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Arr<const N: usize> = [u8; N - 1];
55
| ^ cannot perform const operation using `N`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `N`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: aborting due to previous error
1111

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-
= note: 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-
= note: 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:15: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-
= note: 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:15:19

src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn bar<const N: usize>() -> [u32; foo(N)] {
55
| ^ cannot perform const operation using `N`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `N`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/generic-function-call-in-array-length.rs:12:13
@@ -14,7 +14,7 @@ LL | [0; foo(N)]
1414
| ^ cannot perform const operation using `N`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `N`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/const-generics/generic-sum-in-array-length.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
55
| ^ cannot perform const operation using `A`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `A`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/generic-sum-in-array-length.rs:7:57
@@ -14,7 +14,7 @@ LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
1414
| ^ cannot perform const operation using `B`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `B`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: aborting due to 2 previous errors
2020

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | T: Trait<{std::intrinsics::type_name::<T>()}>
55
| ^ cannot perform const operation using `T`
66
|
77
= note: type parameters may not be used in const expressions
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: `&'static str` is forbidden as the type of a const generic parameter
1111
--> $DIR/intrinsics-type_name-as-const-argument.rs:10:22
@@ -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-
= note: 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-61522-array-len-succ.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
55
| ^^^^^ cannot perform const operation using `COUNT`
66
|
77
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
1111
--> $DIR/issue-61522-array-len-succ.rs:12:30
@@ -14,7 +14,7 @@ LL | fn inner(&self) -> &[u8; COUNT + 1] {
1414
| ^^^^^ cannot perform const operation using `COUNT`
1515
|
1616
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
17-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
17+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
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-
= note: 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/issue-67375.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | inner: [(); { [|_: &T| {}; 0].len() }],
55
| ^ cannot perform const operation using `T`
66
|
77
= note: type parameters may not be used in const expressions
8-
= note: use #![feature(const_generics)] and #![feature(const_evaluatable_checked)] to allow generic const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error[E0392]: parameter `T` is never used
1111
--> $DIR/issue-67375.rs:7:12

0 commit comments

Comments
 (0)