diff options
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 78a914cac..e57d5970f 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -34,7 +34,7 @@ use crate::{ | |||
34 | make_mut_slice, variant_data, | 34 | make_mut_slice, variant_data, |
35 | }, | 35 | }, |
36 | AliasTy, Binders, BoundVar, CallableSig, DebruijnIndex, FnPointer, FnSig, GenericPredicate, | 36 | AliasTy, Binders, BoundVar, CallableSig, DebruijnIndex, FnPointer, FnSig, GenericPredicate, |
37 | OpaqueTy, OpaqueTyId, PolyFnSig, ProjectionPredicate, ProjectionTy, ReturnTypeImplTrait, | 37 | ImplTraitId, OpaqueTy, PolyFnSig, ProjectionPredicate, ProjectionTy, ReturnTypeImplTrait, |
38 | ReturnTypeImplTraits, Substs, TraitEnvironment, TraitRef, Ty, TyKind, TypeWalk, | 38 | ReturnTypeImplTraits, Substs, TraitEnvironment, TraitRef, Ty, TyKind, TypeWalk, |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -228,14 +228,12 @@ impl Ty { | |||
228 | Some(GenericDefId::FunctionId(f)) => f, | 228 | Some(GenericDefId::FunctionId(f)) => f, |
229 | _ => panic!("opaque impl trait lowering in non-function"), | 229 | _ => panic!("opaque impl trait lowering in non-function"), |
230 | }; | 230 | }; |
231 | let impl_trait_id = OpaqueTyId::ReturnTypeImplTrait(func, idx); | 231 | let impl_trait_id = ImplTraitId::ReturnTypeImplTrait(func, idx); |
232 | let opaque_ty_id = ctx.db.intern_impl_trait_id(impl_trait_id).into(); | ||
232 | let generics = generics(ctx.db.upcast(), func.into()); | 233 | let generics = generics(ctx.db.upcast(), func.into()); |
233 | let parameters = Substs::bound_vars(&generics, ctx.in_binders); | 234 | let parameters = Substs::bound_vars(&generics, ctx.in_binders); |
234 | TyKind::Alias(AliasTy::Opaque(OpaqueTy { | 235 | TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, parameters })) |
235 | opaque_ty_id: impl_trait_id, | 236 | .intern(&Interner) |
236 | parameters, | ||
237 | })) | ||
238 | .intern(&Interner) | ||
239 | } | 237 | } |
240 | ImplTraitLoweringMode::Param => { | 238 | ImplTraitLoweringMode::Param => { |
241 | let idx = ctx.impl_trait_counter.get(); | 239 | let idx = ctx.impl_trait_counter.get(); |