about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs2
-rw-r--r--src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr14
2 files changed, 12 insertions, 4 deletions
diff --git a/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs b/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs
index 880e2199dc4..bf3f80807e6 100644
--- a/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs
+++ b/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs
@@ -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() {}
diff --git a/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr b/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr
index 92fad679257..0d9960a663e 100644
--- a/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr
+++ b/src/test/ui/invalid/invalid-rustc_legacy_const_generics-arguments.stderr
@@ -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