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
This commit is contained in:
Skgland 2021-01-26 15:04:09 +01:00
parent 2c33b070ad
commit e1010424dc
No known key found for this signature in database
GPG Key ID: 3BE1A1A3CBC3CF99
1 changed files with 4 additions and 0 deletions

View File

@ -1043,6 +1043,10 @@ impl<'a> ExtCtxt<'a> {
.chain(components.iter().map(|&s| Ident::with_dummy_span(s)))
.collect()
}
pub fn def_site_path(&self, components: &[Symbol]) -> Vec<Ident> {
let def_site = self.with_def_site_ctxt(DUMMY_SP);
components.iter().map(|&s| Ident::new(s, def_site)).collect()
}
pub fn check_unused_macros(&mut self) {
self.resolver.check_unused_macros();