diff options
| author | Skgland <bb-github@t-online.de> | 2021-01-26 15:04:09 +0100 |
|---|---|---|
| committer | Skgland <bb-github@t-online.de> | 2021-02-09 13:42:35 +0100 |
| commit | e1010424dccf684dcf4225b3c6574bb1a9bacf6a (patch) | |
| tree | 74f9eb455dd71c2c97694a167cbf6a2396f2fa4a | |
| parent | 2c33b070ad51c5a80e963beebc5c35ce976f05b5 (diff) | |
| download | rust-e1010424dccf684dcf4225b3c6574bb1a9bacf6a.tar.gz rust-e1010424dccf684dcf4225b3c6574bb1a9bacf6a.zip | |
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
| -rw-r--r-- | compiler/rustc_expand/src/base.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index 196a774355e..e3dc793a7fa 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -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(); |
