mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00

Modify `AttributeTemplate` to support list of alternatives for list and name value attribute styles. Suggestions now provide more correct suggested code: ``` error[E0805]: malformed `used` attribute input --> $DIR/used_with_multi_args.rs:3:1 | LL | #[used(compiler, linker)] | ^^^^^^------------------^ | | | expected a single argument here | help: try changing it to one of the following valid forms of the attribute | LL - #[used(compiler, linker)] LL + #[used(compiler)] | LL - #[used(compiler, linker)] LL + #[used(linker)] | LL - #[used(compiler, linker)] LL + #[used] | ``` instead of the prior "masking" of the lack of this feature by suggesting pipe-separated lists: ``` error[E0805]: malformed `used` attribute input --> $DIR/used_with_multi_args.rs:3:1 | LL | #[used(compiler, linker)] | ^^^^^^------------------^ | | | expected a single argument here | help: try changing it to one of the following valid forms of the attribute | LL - #[used(compiler, linker)] LL + #[used(compiler|linker)] | LL - #[used(compiler, linker)] LL + #[used] | ```
9 lines
266 B
Rust
9 lines
266 B
Rust
// Top-level ill-formed
|
|
#[link] //~ ERROR valid forms for the attribute are
|
|
//~| WARN this was previously accepted
|
|
#[link = "foo"] //~ ERROR valid forms for the attribute are
|
|
//~| WARN this was previously accepted
|
|
extern "C" {}
|
|
|
|
fn main() {}
|