diff options
| author | bors <bors@rust-lang.org> | 2025-09-29 11:52:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-29 11:52:07 +0000 |
| commit | 21a13b8864a7dd614e9a96afd57b58c7fcf0bd6b (patch) | |
| tree | 0f477eb44c222ff56184480566860d942d2e3140 /compiler/rustc_hir | |
| parent | 128b36a4a48534b048845cc744b9672529d13df1 (diff) | |
| parent | 82db672ed5d7822fbc66cfdfad8da264bd2405d5 (diff) | |
| download | rust-21a13b8864a7dd614e9a96afd57b58c7fcf0bd6b.tar.gz rust-21a13b8864a7dd614e9a96afd57b58c7fcf0bd6b.zip | |
Auto merge of #147151 - Zalathar:rollup-w81rn0j, r=Zalathar
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146653 (improve diagnostics for empty attributes) - rust-lang/rust#146987 (impl Ord for params and use unstable sort) - rust-lang/rust#147101 (Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library ) - rust-lang/rust#147123 (Fix removed version numbers of `doc_auto_cfg` and `doc_cfg_hide`) - rust-lang/rust#147149 (add joboet to library review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir')
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/lints.rs | 15 |
2 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 493236718a8..bc1c47e95c3 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1298,10 +1298,7 @@ impl AttributeExt for Attribute { #[inline] fn path_matches(&self, name: &[Symbol]) -> bool { match &self { - Attribute::Unparsed(n) => { - n.path.segments.len() == name.len() - && n.path.segments.iter().zip(name).all(|(s, n)| s.name == *n) - } + Attribute::Unparsed(n) => n.path.segments.iter().map(|ident| &ident.name).eq(name), _ => false, } } 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, |
