diff options
author | Florian Diebold <[email protected]> | 2021-03-13 21:44:36 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-13 21:44:36 +0000 |
commit | 3743ede404d38586db9d7febca14b8bebcbbe0ef (patch) | |
tree | 2d70ac00f2228623ac012576bd881df3edc1c077 /crates/hir | |
parent | d3ca2ab959af672e779757dbcab755b61a4ec091 (diff) |
Move type lowering methods to TyLoweringContext
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index cda050a7d..10b8171be 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -802,7 +802,7 @@ impl Function { | |||
802 | let krate = self.id.lookup(db.upcast()).container.module(db.upcast()).krate(); | 802 | let krate = self.id.lookup(db.upcast()).container.module(db.upcast()).krate(); |
803 | let ret_type = &db.function_data(self.id).ret_type; | 803 | let ret_type = &db.function_data(self.id).ret_type; |
804 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); | 804 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); |
805 | let ty = Ty::from_hir_ext(&ctx, ret_type).0; | 805 | let ty = ctx.lower_ty(ret_type); |
806 | Type::new_with_resolver_inner(db, krate, &resolver, ty) | 806 | Type::new_with_resolver_inner(db, krate, &resolver, ty) |
807 | } | 807 | } |
808 | 808 | ||
@@ -825,7 +825,7 @@ impl Function { | |||
825 | let ty = Type { | 825 | let ty = Type { |
826 | krate, | 826 | krate, |
827 | ty: InEnvironment { | 827 | ty: InEnvironment { |
828 | value: Ty::from_hir_ext(&ctx, type_ref).0, | 828 | value: ctx.lower_ty(type_ref), |
829 | environment: environment.clone(), | 829 | environment: environment.clone(), |
830 | }, | 830 | }, |
831 | }; | 831 | }; |
@@ -1499,7 +1499,7 @@ impl Impl { | |||
1499 | let resolver = self.id.resolver(db.upcast()); | 1499 | let resolver = self.id.resolver(db.upcast()); |
1500 | let krate = self.id.lookup(db.upcast()).container.krate(); | 1500 | let krate = self.id.lookup(db.upcast()).container.krate(); |
1501 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); | 1501 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); |
1502 | let ty = Ty::from_hir(&ctx, &impl_data.target_type); | 1502 | let ty = ctx.lower_ty(&impl_data.target_type); |
1503 | Type::new_with_resolver_inner(db, krate, &resolver, ty) | 1503 | Type::new_with_resolver_inner(db, krate, &resolver, ty) |
1504 | } | 1504 | } |
1505 | 1505 | ||