Skip to content

Commit 591158d

Browse files
committed
Auto merge of rust-lang#130923 - Blindspot22:Support-more-suggestions-in-template-for-bad-attribute-use-rust-lang#61288, r=<try>
Allow multiple suggestions for malformed crate_type attribute Solves these rust-lang#61288
2 parents b9dc4a3 + 8b50267 commit 591158d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/tools/rust-analyzer/crates/hir-expand/src/inert_attr_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct BuiltinAttribute {
2323
#[derive(Clone, Copy)]
2424
pub struct AttributeTemplate {
2525
pub word: bool,
26-
pub list: Option<&'static str>,
26+
pub list: Option<&'static [&'static str]>,
2727
pub name_value_str: Option<&'static str>,
2828
}
2929

tests/ui/no_crate_type.stderr

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ error: malformed `crate_type` attribute input
22
--> $DIR/no_crate_type.rs:2:1
33
|
44
LL | #![crate_type]
5-
| ^^^^^^^^^^^^^^ help: must be of the form: `#![crate_type = "bin|lib|..."]`
6-
7-
error: aborting due to 1 previous error
5+
| ^^^^^^^^^^^^^^ malformed input
6+
help: must be of the form:
7+
|
8+
LL | #![crate_type = "bin"]
9+
|
10+
LL | #![crate_type = "lib"]
11+
|
12+
LL | #![crate_type = "..."]
813

0 commit comments

Comments
 (0)