Don't recreate Hygiene unnecessarily

This commit is contained in:
Lukas Wirth 2023-04-06 21:16:11 +02:00
parent b7c443569a
commit f742943a4b
9 changed files with 35 additions and 51 deletions

View file

@ -12,7 +12,6 @@ use hir_expand::{
use intern::Interned;
use la_arena::{Arena, ArenaMap, Idx};
use once_cell::unsync::Lazy;
use std::ops::DerefMut;
use stdx::impl_from;
use syntax::ast::{self, HasGenericParams, HasName, HasTypeBounds};
@ -328,7 +327,7 @@ impl GenericParams {
pub(crate) fn fill_implicit_impl_trait_args(
&mut self,
db: &dyn DefDatabase,
expander: &mut impl DerefMut<Target = Expander>,
expander: &mut Expander,
type_ref: &TypeRef,
) {
type_ref.walk(&mut |type_ref| {
@ -350,7 +349,7 @@ impl GenericParams {
let macro_call = mc.to_node(db.upcast());
match expander.enter_expand::<ast::Type>(db, macro_call) {
Ok(ExpandResult { value: Some((mark, expanded)), .. }) => {
let ctx = LowerCtx::new(db, expander.current_file_id());
let ctx = expander.ctx(db);
let type_ref = TypeRef::from_ast(&ctx, expanded);
self.fill_implicit_impl_trait_args(db, expander, &type_ref);
expander.exit(db, mark);