mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Move type lowering methods to TyLoweringContext
This commit is contained in:
parent
d3ca2ab959
commit
3743ede404
5 changed files with 249 additions and 289 deletions
|
@ -802,7 +802,7 @@ impl Function {
|
|||
let krate = self.id.lookup(db.upcast()).container.module(db.upcast()).krate();
|
||||
let ret_type = &db.function_data(self.id).ret_type;
|
||||
let ctx = hir_ty::TyLoweringContext::new(db, &resolver);
|
||||
let ty = Ty::from_hir_ext(&ctx, ret_type).0;
|
||||
let ty = ctx.lower_ty(ret_type);
|
||||
Type::new_with_resolver_inner(db, krate, &resolver, ty)
|
||||
}
|
||||
|
||||
|
@ -825,7 +825,7 @@ impl Function {
|
|||
let ty = Type {
|
||||
krate,
|
||||
ty: InEnvironment {
|
||||
value: Ty::from_hir_ext(&ctx, type_ref).0,
|
||||
value: ctx.lower_ty(type_ref),
|
||||
environment: environment.clone(),
|
||||
},
|
||||
};
|
||||
|
@ -1499,7 +1499,7 @@ impl Impl {
|
|||
let resolver = self.id.resolver(db.upcast());
|
||||
let krate = self.id.lookup(db.upcast()).container.krate();
|
||||
let ctx = hir_ty::TyLoweringContext::new(db, &resolver);
|
||||
let ty = Ty::from_hir(&ctx, &impl_data.target_type);
|
||||
let ty = ctx.lower_ty(&impl_data.target_type);
|
||||
Type::new_with_resolver_inner(db, krate, &resolver, ty)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue