Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #19327 from Veykril/push-qyyvkulltzpz
Fix `path` macro hygiene
Lukas Wirth 2025-03-10
parent 430d7c6 · parent af7f89c · commit 5249b8b
-rw-r--r--crates/hir-expand/src/lib.rs2
-rw-r--r--crates/hir-expand/src/mod_path.rs4
-rw-r--r--crates/hir/src/lib.rs1
-rw-r--r--crates/intern/src/symbol/symbols.rs1
4 files changed, 6 insertions, 2 deletions
diff --git a/crates/hir-expand/src/lib.rs b/crates/hir-expand/src/lib.rs
index 41603e3c92..c1d808cbf2 100644
--- a/crates/hir-expand/src/lib.rs
+++ b/crates/hir-expand/src/lib.rs
@@ -5,6 +5,8 @@
//! expansion.
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
+pub use intern;
+
pub mod attrs;
pub mod builtin;
pub mod change;
diff --git a/crates/hir-expand/src/mod_path.rs b/crates/hir-expand/src/mod_path.rs
index f0cf7ebf47..75b5861454 100644
--- a/crates/hir-expand/src/mod_path.rs
+++ b/crates/hir-expand/src/mod_path.rs
@@ -388,7 +388,7 @@ macro_rules! __path {
($start:ident $(:: $seg:ident)*) => ({
$crate::__known_path!($start $(:: $seg)*);
$crate::mod_path::ModPath::from_segments($crate::mod_path::PathKind::Abs, vec![
- $crate::name::Name::new_symbol_root(intern::sym::$start.clone()), $($crate::name::Name::new_symbol_root(intern::sym::$seg.clone()),)*
+ $crate::name::Name::new_symbol_root($crate::intern::sym::$start.clone()), $($crate::name::Name::new_symbol_root($crate::intern::sym::$seg.clone()),)*
])
});
}
@@ -399,7 +399,7 @@ pub use crate::__path as path;
macro_rules! __tool_path {
($start:ident $(:: $seg:ident)*) => ({
$crate::mod_path::ModPath::from_segments($crate::mod_path::PathKind::Plain, vec![
- $crate::name::Name::new_symbol_root(intern::sym::rust_analyzer.clone()), $crate::name::Name::new_symbol_root(intern::sym::$start.clone()), $($crate::name::Name::new_symbol_root(intern::sym::$seg.clone()),)*
+ $crate::name::Name::new_symbol_root($crate::intern::sym::rust_analyzer.clone()), $crate::name::Name::new_symbol_root($crate::intern::sym::$start.clone()), $($crate::name::Name::new_symbol_root($crate::intern::sym::$seg.clone()),)*
])
});
}
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 7549d54a54..cb667767d7 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -139,6 +139,7 @@ pub use {
},
hygiene::{marks_rev, SyntaxContextExt},
inert_attr_macro::AttributeTemplate,
+ mod_path::tool_path,
name::Name,
prettify_macro_expansion,
proc_macro::{ProcMacros, ProcMacrosBuilder},
diff --git a/crates/intern/src/symbol/symbols.rs b/crates/intern/src/symbol/symbols.rs
index be0de6c936..6b77c72cee 100644
--- a/crates/intern/src/symbol/symbols.rs
+++ b/crates/intern/src/symbol/symbols.rs
@@ -185,6 +185,7 @@ define_symbols! {
Clone,
coerce_unsized,
column,
+ completion,
compile_error,
concat_bytes,
concat_idents,