From 2c7dfa91b5b4dcde136880894a9fd4dae70114db Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Mon, 25 Aug 2025 17:53:01 +0200 Subject: Add another case to the bad-lit-suffixes test Signed-off-by: Jonathan Brouwer --- tests/ui/parser/bad-lit-suffixes.rs | 7 +++++++ tests/ui/parser/bad-lit-suffixes.stderr | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'tests/ui/parser') 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`. -- cgit 1.4.1-3-g733a5