Auto merge of #78826 - petrochenkov:mrscopes2, r=eddyb
resolve: Collapse `macro_rules` scope chains on the fly Otherwise they grow too long and you have to endlessly walk through them when resolving macros or imports. Addresses https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Slow.20Builtin.20Derives/near/215750815
This commit is contained in:
commit
a38f8fb674
6 changed files with 70 additions and 30 deletions
|
@ -630,7 +630,7 @@ impl<'a> Resolver<'a> {
|
|||
}
|
||||
}
|
||||
Scope::MacroRules(macro_rules_scope) => {
|
||||
if let MacroRulesScope::Binding(macro_rules_binding) = macro_rules_scope {
|
||||
if let MacroRulesScope::Binding(macro_rules_binding) = macro_rules_scope.get() {
|
||||
let res = macro_rules_binding.binding.res();
|
||||
if filter_fn(res) {
|
||||
suggestions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue