Skip to content

Support more suggestions in template for bad attribute use #61288

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
estebank opened this issue May 28, 2019 · 1 comment
Open

Support more suggestions in template for bad attribute use #61288

estebank opened this issue May 28, 2019 · 1 comment
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

estebank commented May 28, 2019

Modify

pub struct AttributeTemplate {
word: bool,
list: Option<&'static str>,
name_value_str: Option<&'static str>,
}

to allow for multiple suggestions of the same type.

The following

error: malformed `crate_type` attribute input
--> $DIR/no_crate_type.rs:2:1
|
LL | #![crate_type]
| ^^^^^^^^^^^^^^ help: must be of the form: `#[crate_type = "bin|lib|..."]`

should be

error: malformed `crate_type` attribute input
  --> $DIR/no_crate_type.rs:2:1
   |
LL | #![crate_type]
   | ^^^^^^^^^^^^^^ malformed input
help: must be of the form:
   |
LL | #![crate_type = "bin"]
   |
LL | #![crate_type = "lib"]
   |
LL | #![crate_type = "..."]
   |
@estebank estebank added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` labels May 28, 2019
@estebank estebank added the D-papercut Diagnostics: An error or lint that needs small tweaks. label Oct 5, 2019
@estebank estebank added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 21, 2020
@Blindspot22
Copy link

@rustbot claim

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 27, 2024
…-in-template-for-bad-attribute-use-rust-lang#61288, r=<try>

Allow multiple suggestions for malformed crate_type attribute

Solves these rust-lang#61288
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants