mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Auto merge of #17405 - Veykril:modpath-clone, r=Veykril
internal: Don't unnecessarily clone ModPaths in early name res
This commit is contained in:
commit
22648b2655
12 changed files with 29 additions and 30 deletions
|
@ -423,7 +423,7 @@ impl<'db> SemanticsImpl<'db> {
|
|||
let macro_call = InFile::new(file_id, actual_macro_call);
|
||||
let krate = resolver.krate();
|
||||
let macro_call_id = macro_call.as_call_id(self.db.upcast(), krate, |path| {
|
||||
resolver.resolve_path_as_macro_def(self.db.upcast(), &path, Some(MacroSubNs::Bang))
|
||||
resolver.resolve_path_as_macro_def(self.db.upcast(), path, Some(MacroSubNs::Bang))
|
||||
})?;
|
||||
hir_expand::db::expand_speculative(
|
||||
self.db.upcast(),
|
||||
|
|
|
@ -826,7 +826,7 @@ impl SourceAnalyzer {
|
|||
// FIXME: This causes us to parse, generally this is the wrong approach for resolving a
|
||||
// macro call to a macro call id!
|
||||
let macro_call_id = macro_call.as_call_id(db.upcast(), krate, |path| {
|
||||
self.resolver.resolve_path_as_macro_def(db.upcast(), &path, Some(MacroSubNs::Bang))
|
||||
self.resolver.resolve_path_as_macro_def(db.upcast(), path, Some(MacroSubNs::Bang))
|
||||
})?;
|
||||
// why the 64?
|
||||
Some(macro_call_id.as_macro_file()).filter(|it| it.expansion_level(db.upcast()) < 64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue