1
Fork 0

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 #[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 #[rustc_legacy_const_generics] //~ ERROR malformed `rustc_legacy_const_generics` attribute
fn bar1() {} 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.) = 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 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] LL | #[rustc_legacy_const_generics]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
error: malformed `rustc_legacy_const_generics` attribute input 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] LL | #[rustc_legacy_const_generics = 1]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
@ -56,11 +56,19 @@ LL | #[rustc_legacy_const_generics(0)]
LL | struct S; LL | struct S;
| --------- not a function | --------- 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 error: index exceeds number of arguments
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:25:35 --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:25:35
| |
LL | #[rustc_legacy_const_generics(1)] LL | #[rustc_legacy_const_generics(1)]
| ^ there is only 1 argument | ^ there is only 1 argument
error: aborting due to 10 previous errors error: aborting due to 11 previous errors