Skip to content

Commit 6151eb6

Browse files
Add another case to the bad-lit-suffixes test
Signed-off-by: Jonathan Brouwer <[email protected]>
1 parent 93edf9f commit 6151eb6

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

tests/ui/parser/bad-lit-suffixes.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ extern "C" {}
4444
//~^ ERROR invalid suffix `suffix` for number literal
4545
//~| ERROR malformed `rustc_layout_scalar_valid_range_start` attribute input
4646
struct S;
47+
48+
impl S {
49+
#[rustc_confusables("blah"suffix)]
50+
//~^ ERROR suffixes on string literals are invalid
51+
//~| ERROR malformed `rustc_confusables` attribute input
52+
fn woof() { }
53+
}

tests/ui/parser/bad-lit-suffixes.stderr

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ LL | #[rustc_layout_scalar_valid_range_start(0suffix)]
177177
| | expected an integer literal here
178178
| help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]`
179179

180-
error: aborting due to 22 previous errors; 2 warnings emitted
180+
error: suffixes on string literals are invalid
181+
--> $DIR/bad-lit-suffixes.rs:49:25
182+
|
183+
LL | #[rustc_confusables("blah"suffix)]
184+
| ^^^^^^^^^^^^ invalid suffix `suffix`
185+
186+
error[E0539]: malformed `rustc_confusables` attribute input
187+
--> $DIR/bad-lit-suffixes.rs:49:5
188+
|
189+
LL | #[rustc_confusables("blah"suffix)]
190+
| ^^^^^^^^^^^^^^^^^^^^------------^^
191+
| | |
192+
| | expected a string literal here
193+
| help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`
194+
195+
error: aborting due to 24 previous errors; 2 warnings emitted
181196

182197
For more information about this error, try `rustc --explain E0539`.

0 commit comments

Comments
 (0)