diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-29 21:06:44 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-29 21:06:44 +1000 |
| commit | cf07cce1fb79d9d9444fdf34a7c0c3b296a8be6f (patch) | |
| tree | 873c80284ba8d8eec34c2e4d43e1eb5ce82aa695 /compiler/rustc_hir/src | |
| parent | 7af913fc90968844286e5ff6675ab66afa98cdc6 (diff) | |
| parent | b3631e1174e222bf1dadf1549cfd0f717ebf6d64 (diff) | |
| download | rust-cf07cce1fb79d9d9444fdf34a7c0c3b296a8be6f.tar.gz rust-cf07cce1fb79d9d9444fdf34a7c0c3b296a8be6f.zip | |
Rollup merge of #146653 - jdonszelmann:empty-attr-diags, r=nnethercote
improve diagnostics for empty attributes Adds a note about them not having any effect. This was previously done for `feature` attributes but no other attributes. In [converting the `feature` parser](https://github.com/rust-lang/rust/pull/146652) I removed that note. This PR adds it back in and makes it so all attributes benefit from it. Not blocked on rust-lang/rust#146652, either can merge first
Diffstat (limited to 'compiler/rustc_hir/src')
| -rw-r--r-- | compiler/rustc_hir/src/lints.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/rustc_hir/src/lints.rs b/compiler/rustc_hir/src/lints.rs index b7a0a6a0c19..c9de6f6b5d5 100644 --- a/compiler/rustc_hir/src/lints.rs +++ b/compiler/rustc_hir/src/lints.rs @@ -31,6 +31,12 @@ pub struct AttributeLint<Id> { #[derive(Clone, Debug, HashStable_Generic)] pub enum AttributeLintKind { + /// Copy of `IllFormedAttributeInput` + /// specifically for the `invalid_macro_export_arguments` lint until that is removed, + /// see <https://github.com/rust-lang/rust/pull/143857#issuecomment-3079175663> + InvalidMacroExportArguments { + suggestions: Vec<String>, + }, UnusedDuplicate { this: Span, other: Span, @@ -41,13 +47,8 @@ pub enum AttributeLintKind { }, EmptyAttribute { first_span: Span, - }, - - /// Copy of `IllFormedAttributeInput` - /// specifically for the `invalid_macro_export_arguments` lint until that is removed, - /// see <https://github.com/rust-lang/rust/pull/143857#issuecomment-3079175663> - InvalidMacroExportArguments { - suggestions: Vec<String>, + attr_path: AttrPath, + valid_without_list: bool, }, InvalidTarget { name: AttrPath, |
