about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/invalid/invalid_rustc_layout_scalar_valid_range.stderr38
-rw-r--r--tests/ui/parser/bad-lit-suffixes.rs1
-rw-r--r--tests/ui/parser/bad-lit-suffixes.stderr12
3 files changed, 38 insertions, 13 deletions
diff --git a/tests/ui/invalid/invalid_rustc_layout_scalar_valid_range.stderr b/tests/ui/invalid/invalid_rustc_layout_scalar_valid_range.stderr
index 7879e7358c0..8b9ad78db37 100644
--- a/tests/ui/invalid/invalid_rustc_layout_scalar_valid_range.stderr
+++ b/tests/ui/invalid/invalid_rustc_layout_scalar_valid_range.stderr
@@ -1,20 +1,38 @@
-error: expected exactly one integer literal argument
+error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input
   --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:3:1
    |
 LL | #[rustc_layout_scalar_valid_range_start(u32::MAX)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------^^
+   | |                                       |
+   | |                                       expected an integer literal here
+   | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]`
 
-error: expected exactly one integer literal argument
+error[E0805]: malformed `rustc_layout_scalar_valid_range_end` attribute input
   --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:6:1
    |
 LL | #[rustc_layout_scalar_valid_range_end(1, 2)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^
+   | |                                    |
+   | |                                    expected a single argument here
+   | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]`
 
-error: expected exactly one integer literal argument
+error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input
   --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:9:1
    |
 LL | #[rustc_layout_scalar_valid_range_end(a = "a")]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^
+   | |                                     |
+   | |                                     expected an integer literal here
+   | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]`
+
+error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input
+  --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:18:1
+   |
+LL | #[rustc_layout_scalar_valid_range_start(rustc_layout_scalar_valid_range_start)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------------^^
+   | |                                       |
+   | |                                       expected an integer literal here
+   | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]`
 
 error: attribute should be applied to a struct
   --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:12:1
@@ -27,11 +45,7 @@ LL | |     Y = 14,
 LL | | }
    | |_- not a struct
 
-error: expected exactly one integer literal argument
-  --> $DIR/invalid_rustc_layout_scalar_valid_range.rs:18:1
-   |
-LL | #[rustc_layout_scalar_valid_range_start(rustc_layout_scalar_valid_range_start)]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error: aborting due to 5 previous errors
 
+Some errors have detailed explanations: E0539, E0805.
+For more information about an error, try `rustc --explain E0539`.
diff --git a/tests/ui/parser/bad-lit-suffixes.rs b/tests/ui/parser/bad-lit-suffixes.rs
index 4e8edf4d46e..13287aabb1d 100644
--- a/tests/ui/parser/bad-lit-suffixes.rs
+++ b/tests/ui/parser/bad-lit-suffixes.rs
@@ -41,4 +41,5 @@ extern "C" {}
 
 #[rustc_layout_scalar_valid_range_start(0suffix)]
 //~^ ERROR invalid suffix `suffix` for number literal
+//~| ERROR malformed `rustc_layout_scalar_valid_range_start` attribute input
 struct S;
diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr
index 416143e496a..295e3112ec0 100644
--- a/tests/ui/parser/bad-lit-suffixes.stderr
+++ b/tests/ui/parser/bad-lit-suffixes.stderr
@@ -150,5 +150,15 @@ LL |     1.0e10suffix;
    |
    = help: valid suffixes are `f32` and `f64`
 
-error: aborting due to 20 previous errors; 2 warnings emitted
+error[E0805]: malformed `rustc_layout_scalar_valid_range_start` attribute input
+  --> $DIR/bad-lit-suffixes.rs:42:1
+   |
+LL | #[rustc_layout_scalar_valid_range_start(0suffix)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^
+   | |                                      |
+   | |                                      expected a single argument here
+   | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]`
+
+error: aborting due to 21 previous errors; 2 warnings emitted
 
+For more information about this error, try `rustc --explain E0805`.