diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-07-07 03:26:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-07 03:26:06 +0200 |
| commit | 11b24c108da6eaea35b785e8b0fc5f688d13c4bf (patch) | |
| tree | e462f5febabe4fedfc0e7b881d4bd36c2a9ba4bf /compiler/rustc_passes/src | |
| parent | 00c67d1a127ab6be6ada45647ea3abed0a628f60 (diff) | |
| parent | 244d64e60b94d9ffba58a2f4e38430378aa79037 (diff) | |
| download | rust-11b24c108da6eaea35b785e8b0fc5f688d13c4bf.tar.gz rust-11b24c108da6eaea35b785e8b0fc5f688d13c4bf.zip | |
Rollup merge of #143344 - JonathanBrouwer:path-parser, r=jdonszelmann
Port `#[path]` to the new attribute parsing infrastructure Ports `#[path]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 This PR duplicates a change from https://github.com/rust-lang/rust/pull/143237 Draft until that one is merged
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index b8f1ec7ca93..fe9f80beaed 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -191,6 +191,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> { target, Target::Mod, ), + Attribute::Parsed(AttributeKind::Path(_, attr_span)) => { + self.check_generic_attr(hir_id, sym::path, *attr_span, target, Target::Mod) + } Attribute::Parsed(AttributeKind::TrackCaller(attr_span)) => { self.check_track_caller(hir_id, *attr_span, attrs, span, target) } @@ -2797,7 +2800,6 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) { // resolution for the attribute macro error. const ATTRS_TO_CHECK: &[Symbol] = &[ sym::macro_export, - sym::path, sym::automatically_derived, sym::rustc_main, sym::derive, @@ -2819,6 +2821,8 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) { }) = attr { (*first_attr_span, sym::repr) + } else if let Attribute::Parsed(AttributeKind::Path(.., span)) = attr { + (*span, sym::path) } else { continue; }; |
