diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/parser/bad-lit-suffixes.rs | 8 | ||||
| -rw-r--r-- | tests/ui/parser/bad-lit-suffixes.stderr | 40 |
2 files changed, 12 insertions, 36 deletions
diff --git a/tests/ui/parser/bad-lit-suffixes.rs b/tests/ui/parser/bad-lit-suffixes.rs index 91b32fd4539..0a1ee120730 100644 --- a/tests/ui/parser/bad-lit-suffixes.rs +++ b/tests/ui/parser/bad-lit-suffixes.rs @@ -38,10 +38,14 @@ fn g() {} #[link(name = "string"suffix)] //~^ ERROR suffixes on string literals are invalid -//~| ERROR malformed `link` attribute input extern "C" {} #[rustc_layout_scalar_valid_range_start(0suffix)] //~^ 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 + fn woof() { } +} diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index 217cc74b8eb..6c3dbbcec64 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -160,48 +160,20 @@ error: suffixes on string literals are invalid LL | #[link(name = "string"suffix)] | ^^^^^^^^^^^^^^ invalid suffix `suffix` -error[E0539]: malformed `link` attribute input - --> $DIR/bad-lit-suffixes.rs:39:1 - | -LL | #[link(name = "string"suffix)] - | ^^^^^^^---------------------^^ - | | - | expected this to be of the form `name = "..."` - | - = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> -help: try changing it to one of the following valid forms of the attribute - | -LL - #[link(name = "string"suffix)] -LL + #[link(name = "...")] - | -LL - #[link(name = "string"suffix)] -LL + #[link(name = "...", import_name_type = "decorated|noprefix|undecorated")] - | -LL - #[link(name = "string"suffix)] -LL + #[link(name = "...", kind = "dylib|static|...")] - | -LL - #[link(name = "string"suffix)] -LL + #[link(name = "...", kind = "dylib|static|...", wasm_import_module = "...", import_name_type = "decorated|noprefix|undecorated")] - | - = and 1 other candidate - error: invalid suffix `suffix` for number literal - --> $DIR/bad-lit-suffixes.rs:44:41 + --> $DIR/bad-lit-suffixes.rs:43:41 | LL | #[rustc_layout_scalar_valid_range_start(0suffix)] | ^^^^^^^ invalid suffix `suffix` | = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) -error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input - --> $DIR/bad-lit-suffixes.rs:44:1 +error: suffixes on string literals are invalid + --> $DIR/bad-lit-suffixes.rs:48:25 | -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)]` +LL | #[rustc_confusables("blah"suffix)] + | ^^^^^^^^^^^^ invalid suffix `suffix` -error: aborting due to 23 previous errors; 2 warnings emitted +error: aborting due to 22 previous errors; 2 warnings emitted For more information about this error, try `rustc --explain E0539`. |
