Skip to content

Commit e101042

Browse files
committed
add method to construct def site path as a vec of idents
like std_path but used dummy span for all path elements and does not perpend kw:DollarCrate
1 parent 2c33b07 commit e101042

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_expand/src/base.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,10 @@ impl<'a> ExtCtxt<'a> {
10431043
.chain(components.iter().map(|&s| Ident::with_dummy_span(s)))
10441044
.collect()
10451045
}
1046+
pub fn def_site_path(&self, components: &[Symbol]) -> Vec<Ident> {
1047+
let def_site = self.with_def_site_ctxt(DUMMY_SP);
1048+
components.iter().map(|&s| Ident::new(s, def_site)).collect()
1049+
}
10461050

10471051
pub fn check_unused_macros(&mut self) {
10481052
self.resolver.check_unused_macros();

0 commit comments

Comments
 (0)