bless tests

This commit is contained in:
Ellen 2021-10-23 17:46:47 +01:00
parent db9b8cef86
commit 433e13279d
13 changed files with 24 additions and 54 deletions

View File

@ -1,9 +0,0 @@
#[cfg(FALSE)]
struct A<const N: usize = 3>;
//~^ ERROR default values for const generic parameters are experimental
#[cfg(FALSE)]
fn foo<const B: bool = false>() {}
//~^ ERROR default values for const generic parameters are experimental
fn main() {}

View File

@ -1,21 +0,0 @@
error[E0658]: default values for const generic parameters are experimental
--> $DIR/feature-gate-const_generics_defaults.rs:2:25
|
LL | struct A<const N: usize = 3>;
| ^^^
|
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
error[E0658]: default values for const generic parameters are experimental
--> $DIR/feature-gate-const_generics_defaults.rs:6:22
|
LL | fn foo<const B: bool = false>() {}
| ^^^^^^^
|
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: add `#![feature(const_generics_defaults)]` to the crate attributes to enable
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

@ -1,5 +1,5 @@
error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-59508-1.rs:11:25
--> $DIR/issue-59508-1.rs:10:25
|
LL | pub fn do_things<T, 'a, 'b: 'a>() {
| ----^^--^^----- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b: 'a, T>`

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-59508.rs:10:25
|
LL | pub fn do_things<T, 'a, 'b: 'a>() {
| ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>`
| ----^^--^^----- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b: 'a, T>`
error: aborting due to previous error

View File

@ -2,25 +2,25 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/lifetime-before-type-params.rs:2:13
|
LL | fn first<T, 'a, 'b>() {}
| ----^^--^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| ----^^--^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/lifetime-before-type-params.rs:4:18
|
LL | fn second<'a, T, 'b>() {}
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/lifetime-before-type-params.rs:6:16
|
LL | fn third<T, U, 'a>() {}
| -------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>`
| -------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/lifetime-before-type-params.rs:8:18
|
LL | fn fourth<'a, T, 'b, U, 'c, V>() {}
| --------^^-----^^---- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, 'c, T, U, V>`
| --------^^-----^^---- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, 'c, T, U, V>`
error: aborting due to 4 previous errors

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-80512-param-reordering-with-defaults.rs:3:18
|
LL | struct S<T = (), 'a>(&'a T);
| ---------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T = ()>`
| ---------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T = ()>`
error: aborting due to previous error

View File

@ -1,5 +1,5 @@
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:6:8
--> $DIR/missing-type-parameter2.rs:3:8
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
@ -17,7 +17,7 @@ LL | impl<N> X<N> {}
| +++
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:9:28
--> $DIR/missing-type-parameter2.rs:6:28
|
LL | impl<T, const A: u8 = 2> X<N> {}
| - ^
@ -34,7 +34,7 @@ LL | impl<T, const A: u8 = 2, N> X<N> {}
| +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:20
--> $DIR/missing-type-parameter2.rs:11:20
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
@ -52,7 +52,7 @@ LL | fn foo<T>(_: T) where T: Send {}
| +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:11
--> $DIR/missing-type-parameter2.rs:11:11
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
@ -70,7 +70,7 @@ LL | fn foo<T>(_: T) where T: Send {}
| +++
error[E0412]: cannot find type `A` in this scope
--> $DIR/missing-type-parameter2.rs:18:24
--> $DIR/missing-type-parameter2.rs:15:24
|
LL | struct X<const N: u8>();
| ------------------------ similarly named struct `X` defined here
@ -88,7 +88,7 @@ LL | fn bar<const N: u8, A>(_: A) {}
| +++
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:6:8
--> $DIR/missing-type-parameter2.rs:3:8
|
LL | impl X<N> {}
| ^
@ -99,13 +99,13 @@ LL | impl X<{ N }> {}
| + +
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/missing-type-parameter2.rs:9:15
--> $DIR/missing-type-parameter2.rs:6:15
|
LL | impl<T, const A: u8 = 2> X<N> {}
| ^
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:9:28
--> $DIR/missing-type-parameter2.rs:6:28
|
LL | impl<T, const A: u8 = 2> X<N> {}
| ^

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-enum.rs:1:15
|
LL | enum X<'a, T, 'b> {
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-fn-def.rs:1:15
|
LL | fn foo<'a, T, 'b>(x: &'a T) {}
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-impl.rs:3:13
|
LL | impl<'a, T, 'b> X<T> {}
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-struct.rs:1:17
|
LL | struct X<'a, T, 'b> {
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-trait.rs:1:18
|
LL | trait Foo<'a, T, 'b> {}
| --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
error: aborting due to previous error

View File

@ -2,25 +2,25 @@ error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:1:13
|
LL | struct A<T, 'a> {
| ----^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T>`
| ----^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:5:13
|
LL | struct B<T, 'a, U> {
| ----^^---- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>`
| ----^^---- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:10:16
|
LL | struct C<T, U, 'a> {
| -------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>`
| -------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:15:16
|
LL | struct D<T, U, 'a, 'b, V, 'c> {
| -------^^--^^-----^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, 'c, T, U, V>`
| -------^^--^^-----^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, 'c, T, U, V>`
error: aborting due to 4 previous errors