Skip to content

Commit cccd779

Browse files
committed
Fix tests
1 parent 2451f12 commit cccd779

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern {
2727
}
2828

2929
#[rustc_legacy_const_generics(0)] //~ ERROR #[rustc_legacy_const_generics] functions must only have
30-
fn foo3<X>() {}
30+
fn foo8<X>() {}
3131

3232
#[rustc_legacy_const_generics] //~ ERROR malformed `rustc_legacy_const_generics` attribute
3333
fn bar1() {}

src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ LL | #[rustc_legacy_const_generics(0usize)]
77
= help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
88

99
error: malformed `rustc_legacy_const_generics` attribute input
10-
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:1
10+
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:32:1
1111
|
1212
LL | #[rustc_legacy_const_generics]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
1414

1515
error: malformed `rustc_legacy_const_generics` attribute input
16-
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:32:1
16+
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:35:1
1717
|
1818
LL | #[rustc_legacy_const_generics = 1]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_legacy_const_generics(N)]`
@@ -56,11 +56,19 @@ LL | #[rustc_legacy_const_generics(0)]
5656
LL | struct S;
5757
| --------- not a function
5858

59+
error: #[rustc_legacy_const_generics] functions must only have const generics
60+
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:31
61+
|
62+
LL | #[rustc_legacy_const_generics(0)]
63+
| ^
64+
LL | fn foo8<X>() {}
65+
| - non-const generic parameter
66+
5967
error: index exceeds number of arguments
6068
--> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:25:35
6169
|
6270
LL | #[rustc_legacy_const_generics(1)]
6371
| ^ there is only 1 argument
6472

65-
error: aborting due to 10 previous errors
73+
error: aborting due to 11 previous errors
6674

0 commit comments

Comments
 (0)