mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
resolve: Pre-intern tool module bindings
This commit is contained in:
parent
05010b6074
commit
d1f8ea417c
@ -572,8 +572,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||
)),
|
||||
}
|
||||
}
|
||||
Scope::ToolPrelude => match this.registered_tools.get(&ident).cloned() {
|
||||
Some(ident) => ok(Res::ToolMod, ident.span, this.arenas),
|
||||
Scope::ToolPrelude => match this.registered_tool_bindings.get(&ident) {
|
||||
Some(binding) => Ok((*binding, Flags::empty())),
|
||||
None => Err(Determinacy::Determined),
|
||||
},
|
||||
Scope::StdLibPrelude => {
|
||||
|
@ -1006,6 +1006,7 @@ pub struct Resolver<'a, 'tcx> {
|
||||
dummy_binding: NameBinding<'a>,
|
||||
builtin_types_bindings: FxHashMap<Symbol, NameBinding<'a>>,
|
||||
builtin_attrs_bindings: FxHashMap<Symbol, NameBinding<'a>>,
|
||||
registered_tool_bindings: FxHashMap<Ident, NameBinding<'a>>,
|
||||
|
||||
used_extern_options: FxHashSet<Symbol>,
|
||||
macro_names: FxHashSet<Ident>,
|
||||
@ -1359,6 +1360,14 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||
(builtin_attr.name, binding)
|
||||
})
|
||||
.collect(),
|
||||
registered_tool_bindings: registered_tools
|
||||
.iter()
|
||||
.map(|ident| {
|
||||
let binding = (Res::ToolMod, pub_vis, ident.span, LocalExpnId::ROOT)
|
||||
.to_name_binding(arenas);
|
||||
(*ident, binding)
|
||||
})
|
||||
.collect(),
|
||||
|
||||
used_extern_options: Default::default(),
|
||||
macro_names: FxHashSet::default(),
|
||||
|
Loading…
Reference in New Issue
Block a user