Skip to content

Commit

Permalink
Swap note for help
Browse files Browse the repository at this point in the history
  • Loading branch information
mendess committed Nov 24, 2020
1 parent af978e3 commit 888055e
Show file tree
Hide file tree
Showing 56 changed files with 113 additions and 113 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | struct ArithArrayLen<const N: usize>([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
Expand All @@ -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
Expand All @@ -23,7 +23,7 @@ LL | struct B<const CFG: Config> {
| ^^^^^^
|
= 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

14 changes: 7 additions & 7 deletions src/test/ui/const-generics/const-arg-in-const-arg.min.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | let _: [u8; foo::<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/const-arg-in-const-arg.rs:15:23
Expand All @@ -14,7 +14,7 @@ LL | let _: [u8; 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/const-arg-in-const-arg.rs:25:23
Expand All @@ -23,7 +23,7 @@ LL | let _ = [0; 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/const-arg-in-const-arg.rs:30:24
Expand All @@ -32,7 +32,7 @@ LL | let _: Foo<{ foo::<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/const-arg-in-const-arg.rs:31:24
Expand All @@ -41,7 +41,7 @@ LL | let _: Foo<{ 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/const-arg-in-const-arg.rs:36:27
Expand All @@ -50,7 +50,7 @@ LL | let _ = Foo::<{ foo::<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/const-arg-in-const-arg.rs:37:27
Expand All @@ -59,7 +59,7 @@ LL | let _ = Foo::<{ 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[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:16:23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | pad: [u8; is_zst::<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[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:17:12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LL | fn bar<const X: (), 'a>(_: &'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
Expand All @@ -26,7 +26,7 @@ LL | fn foo<const X: (), T>(_: &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

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LL | struct A<const N: &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: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:16:15
Expand All @@ -44,7 +44,7 @@ LL | impl<const N: &u8> A<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: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:24:15
Expand All @@ -53,7 +53,7 @@ LL | impl<const N: &u8> B for A<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: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:28:17
Expand All @@ -62,7 +62,7 @@ LL | fn bar<const N: &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: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:19:21
Expand All @@ -71,7 +71,7 @@ LL | fn foo<const M: &u8>(&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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); 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
Expand All @@ -26,7 +26,7 @@ LL | pub struct SelfDependent<const N: [u8; 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: aborting due to 4 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | type Arr<const N: usize> = [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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn test<const N: usize>() -> [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
Expand All @@ -14,7 +14,7 @@ LL | fn test<const N: usize>() -> [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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | type Arr<const N: usize> = [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

2 changes: 1 addition & 1 deletion src/test/ui/const-generics/different_byref.min.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | struct Const<const V: [usize; 1]> {}
| ^^^^^^^^^^
|
= 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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | struct B<const X: A>; // 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
Expand All @@ -14,7 +14,7 @@ LL | struct D<const X: C>;
| ^
|
= 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn bar<const N: usize>() -> [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
Expand All @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | fn foo<const A: usize, const B: usize>(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
Expand All @@ -14,7 +14,7 @@ LL | fn foo<const A: usize, const B: usize>(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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | T: Trait<{std::intrinsics::type_name::<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: `&'static str` is forbidden as the type of a const generic parameter
--> $DIR/intrinsics-type_name-as-const-argument.rs:10:22
Expand All @@ -14,7 +14,7 @@ LL | trait Trait<const S: &'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: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | pub struct MyArray<const COUNT: usize>([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
Expand All @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | trait Trait<const NAME: &'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: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issue-67375.min.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 888055e

Please sign in to comment.