diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-08-25 17:53:01 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-08-28 19:23:55 +0200 |
| commit | 2c7dfa91b5b4dcde136880894a9fd4dae70114db (patch) | |
| tree | 53ea9561b331a150d8bffa1cc450f0f246b72df6 | |
| parent | 1f7dcc878d73c45cc40018aac6e5c767446df110 (diff) | |
| download | rust-2c7dfa91b5b4dcde136880894a9fd4dae70114db.tar.gz rust-2c7dfa91b5b4dcde136880894a9fd4dae70114db.zip | |
Add another case to the bad-lit-suffixes test
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
| -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`. |
