diff options
| author | bors <bors@rust-lang.org> | 2022-06-15 05:39:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-15 05:39:29 +0000 |
| commit | 389352c4bbd56024eefd1566e06dcba04d223f92 (patch) | |
| tree | edb2f035bc8ad77fd480002ddfc6d6562cde5a2f /compiler/rustc_resolve/src/lib.rs | |
| parent | ddb6cc85243ac4761fbc32a407b10216544fe57b (diff) | |
| parent | 1b8fc2f8f66f49bfa1538eeac2a9bd776833b22f (diff) | |
| download | rust-389352c4bbd56024eefd1566e06dcba04d223f92.tar.gz rust-389352c4bbd56024eefd1566e06dcba04d223f92.zip | |
Auto merge of #98123 - JohnTitor:rollup-rfg1a4s, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #97822 (Filter out intrinsics if we have other import candidates to suggest) - #98026 (Move some tests to more reasonable directories) - #98067 (compiler: remove unused deps) - #98078 (Use unchecked mul to compute slice sizes) - #98083 (Rename rustc_serialize::opaque::Encoder as MemEncoder.) - #98087 (Suggest adding a `#[macro_export]` to a private macro) - #98113 (Fix misspelling of "constraint" as "contraint") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 92a65fe249f..ac4e23cc04d 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -866,6 +866,12 @@ struct DeriveData { has_derive_copy: bool, } +#[derive(Clone)] +struct MacroData { + ext: Lrc<SyntaxExtension>, + macro_rules: bool, +} + /// The main resolver class. /// /// This is the visitor that walks the whole crate. @@ -965,7 +971,7 @@ pub struct Resolver<'a> { registered_attrs: FxHashSet<Ident>, registered_tools: RegisteredTools, macro_use_prelude: FxHashMap<Symbol, &'a NameBinding<'a>>, - macro_map: FxHashMap<DefId, Lrc<SyntaxExtension>>, + macro_map: FxHashMap<DefId, MacroData>, dummy_ext_bang: Lrc<SyntaxExtension>, dummy_ext_derive: Lrc<SyntaxExtension>, non_macro_attr: Lrc<SyntaxExtension>, @@ -1522,7 +1528,7 @@ impl<'a> Resolver<'a> { } fn is_builtin_macro(&mut self, res: Res) -> bool { - self.get_macro(res).map_or(false, |ext| ext.builtin_name.is_some()) + self.get_macro(res).map_or(false, |macro_data| macro_data.ext.builtin_name.is_some()) } fn macro_def(&self, mut ctxt: SyntaxContext) -> DefId { |
