diff options
| -rw-r--r-- | tests/ui/parser/bad-lit-suffixes.rs | 7 | ||||
| -rw-r--r-- | tests/ui/parser/bad-lit-suffixes.stderr | 17 |
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/ui/parser/bad-lit-suffixes.rs b/tests/ui/parser/bad-lit-suffixes.rs index 91b32fd4539..792d4a140fc 100644 --- a/tests/ui/parser/bad-lit-suffixes.rs +++ b/tests/ui/parser/bad-lit-suffixes.rs @@ -45,3 +45,10 @@ extern "C" {} //~^ ERROR invalid suffix `suffix` for number literal //~| ERROR malformed `rustc_layout_scalar_valid_range_start` attribute input struct S; + +impl S { + #[rustc_confusables("blah"suffix)] + //~^ ERROR suffixes on string literals are invalid + //~| ERROR malformed `rustc_confusables` attribute input + fn woof() { } +} \ No newline at end of file diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index 217cc74b8eb..952695ed0a4 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -202,6 +202,21 @@ LL | #[rustc_layout_scalar_valid_range_start(0suffix)] | | expected an integer literal here | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]` -error: aborting due to 23 previous errors; 2 warnings emitted +error: suffixes on string literals are invalid + --> $DIR/bad-lit-suffixes.rs:50:25 + | +LL | #[rustc_confusables("blah"suffix)] + | ^^^^^^^^^^^^ invalid suffix `suffix` + +error[E0539]: malformed `rustc_confusables` attribute input + --> $DIR/bad-lit-suffixes.rs:50:5 + | +LL | #[rustc_confusables("blah"suffix)] + | ^^^^^^^^^^^^^^^^^^^^------------^^ + | | | + | | expected a string literal here + | help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]` + +error: aborting due to 25 previous errors; 2 warnings emitted For more information about this error, try `rustc --explain E0539`. |
