Skip to content

Commit 2c7dfa9

Browse files
Add another case to the bad-lit-suffixes test
Signed-off-by: Jonathan Brouwer <[email protected]>
1 parent 1f7dcc8 commit 2c7dfa9

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
@@ -45,3 +45,10 @@ extern "C" {}
4545
//~^ ERROR invalid suffix `suffix` for number literal
4646
//~| ERROR malformed `rustc_layout_scalar_valid_range_start` attribute input
4747
struct S;
48+
49+
impl S {
50+
#[rustc_confusables("blah"suffix)]
51+
//~^ ERROR suffixes on string literals are invalid
52+
//~| ERROR malformed `rustc_confusables` attribute input
53+
fn woof() { }
54+
}

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

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

205-
error: aborting due to 23 previous errors; 2 warnings emitted
205+
error: suffixes on string literals are invalid
206+
--> $DIR/bad-lit-suffixes.rs:50:25
207+
|
208+
LL | #[rustc_confusables("blah"suffix)]
209+
| ^^^^^^^^^^^^ invalid suffix `suffix`
210+
211+
error[E0539]: malformed `rustc_confusables` attribute input
212+
--> $DIR/bad-lit-suffixes.rs:50:5
213+
|
214+
LL | #[rustc_confusables("blah"suffix)]
215+
| ^^^^^^^^^^^^^^^^^^^^------------^^
216+
| | |
217+
| | expected a string literal here
218+
| help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`
219+
220+
error: aborting due to 25 previous errors; 2 warnings emitted
206221

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

0 commit comments

Comments
 (0)