1
Fork 0

Merge pull request #19327 from Veykril/push-qyyvkulltzpz

Fix `path` macro hygiene
This commit is contained in:
Lukas Wirth 2025-03-10 08:45:04 +00:00 committed by GitHub
commit f53d1eba48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 2 deletions

View file

@ -5,6 +5,8 @@
//! expansion. //! expansion.
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
pub use intern;
pub mod attrs; pub mod attrs;
pub mod builtin; pub mod builtin;
pub mod change; pub mod change;

View file

@ -388,7 +388,7 @@ macro_rules! __path {
($start:ident $(:: $seg:ident)*) => ({ ($start:ident $(:: $seg:ident)*) => ({
$crate::__known_path!($start $(:: $seg)*); $crate::__known_path!($start $(:: $seg)*);
$crate::mod_path::ModPath::from_segments($crate::mod_path::PathKind::Abs, vec![ $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 { macro_rules! __tool_path {
($start:ident $(:: $seg:ident)*) => ({ ($start:ident $(:: $seg:ident)*) => ({
$crate::mod_path::ModPath::from_segments($crate::mod_path::PathKind::Plain, vec![ $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()),)*
]) ])
}); });
} }

View file

@ -139,6 +139,7 @@ pub use {
}, },
hygiene::{marks_rev, SyntaxContextExt}, hygiene::{marks_rev, SyntaxContextExt},
inert_attr_macro::AttributeTemplate, inert_attr_macro::AttributeTemplate,
mod_path::tool_path,
name::Name, name::Name,
prettify_macro_expansion, prettify_macro_expansion,
proc_macro::{ProcMacros, ProcMacrosBuilder}, proc_macro::{ProcMacros, ProcMacrosBuilder},

View file

@ -185,6 +185,7 @@ define_symbols! {
Clone, Clone,
coerce_unsized, coerce_unsized,
column, column,
completion,
compile_error, compile_error,
concat_bytes, concat_bytes,
concat_idents, concat_idents,