about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/check_attr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-20 20:01:43 +0000
committerbors <bors@rust-lang.org>2025-06-20 20:01:43 +0000
commit5526a2f47cd676ceeedc08cf71ae75ce2e9284ae (patch)
tree6523283d32a8e9bc33bbe861bd2cda6a6397f7b8 /compiler/rustc_passes/src/check_attr.rs
parent9c4ff566babe632af5e30281a822d1ae9972873b (diff)
parente7cc4ec8f78a43ed9d0c68731d9a1ef1ec688b0c (diff)
downloadrust-5526a2f47cd676ceeedc08cf71ae75ce2e9284ae.tar.gz
rust-5526a2f47cd676ceeedc08cf71ae75ce2e9284ae.zip
Auto merge of #142795 - Kobzol:rollup-vvnnjno, r=Kobzol
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#142629 (Add config builder for bootstrap tests)
 - rust-lang/rust#142715 (correct template for `#[align]` attribute)
 - rust-lang/rust#142720 (De-dup common code from `ExternalCrate` methods)
 - rust-lang/rust#142736 (add issue template for rustdoc)
 - rust-lang/rust#142743 (rustc-dev-guide subtree update)
 - rust-lang/rust#142744 (Add a mailmap entry for y21)
 - rust-lang/rust#142758 (Make sure to rebuild rustdoc if `src/rustdoc-json-types` is changed)
 - rust-lang/rust#142764 (Convert `ilog(10)` to `ilog10()`)
 - rust-lang/rust#142767 (Some symbol and PathRoot cleanups)
 - rust-lang/rust#142769 (remove equivalent new method on context)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_passes/src/check_attr.rs')
-rw-r--r--compiler/rustc_passes/src/check_attr.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index a5d2ad4dc20..e5d918b8b96 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -35,7 +35,7 @@ use rustc_session::lint::builtin::{
     UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES,
 };
 use rustc_session::parse::feature_err;
-use rustc_span::{BytePos, DUMMY_SP, Span, Symbol, edition, sym};
+use rustc_span::{BytePos, DUMMY_SP, Span, Symbol, edition, kw, sym};
 use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
 use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs};
 use rustc_trait_selection::traits::ObligationCtxt;
@@ -724,7 +724,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                         && !matches!(other_attr.path().as_slice(), [sym::rustfmt, ..])
                     {
                         let path = other_attr.path();
-                        let path: Vec<_> = path.iter().map(|s| s.as_str()).collect();
+                        let path: Vec<_> = path
+                            .iter()
+                            .map(|s| if *s == kw::PathRoot { "" } else { s.as_str() })
+                            .collect();
                         let other_attr_name = path.join("::");
 
                         self.dcx().emit_err(errors::NakedFunctionIncompatibleAttribute {