Fix tests

This commit is contained in:
Amanieu d'Antras 2021-02-25 00:37:42 +00:00
parent 2451f124c9
commit cccd77955b
2 changed files with 12 additions and 4 deletions

View File

@ -27,7 +27,7 @@ extern {
}
#[rustc_legacy_const_generics(0)] //~ ERROR #[rustc_legacy_const_generics] functions must only have
fn foo3<X>() {}
fn foo8<X>() {}
#[rustc_legacy_const_generics] //~ ERROR malformed `rustc_legacy_const_generics` attribute
fn bar1() {}

View File

@ -7,13 +7,13 @@ LL | #[rustc_legacy_const_generics(0usize)]
= help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
error: malformed `rustc_legacy_const_generics` attribute input
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:1
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:32:1
|
LL | #[rustc_legacy_const_generics]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
error: malformed `rustc_legacy_const_generics` attribute input
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:32:1
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:35:1
|
LL | #[rustc_legacy_const_generics = 1]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
@ -56,11 +56,19 @@ LL | #[rustc_legacy_const_generics(0)]
LL | struct S;
| --------- not a function
error: #[rustc_legacy_const_generics] functions must only have const generics
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:31
|
LL | #[rustc_legacy_const_generics(0)]
| ^
LL | fn foo8<X>() {}
| - non-const generic parameter
error: index exceeds number of arguments
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:25:35
|
LL | #[rustc_legacy_const_generics(1)]
| ^ there is only 1 argument
error: aborting due to 10 previous errors
error: aborting due to 11 previous errors