File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -278,16 +278,16 @@ impl InferenceTable<'_> {
278
278
279
279
// If we are coercing into an ATPIT, coerce into its proxy inference var, instead.
280
280
let mut to_ty = to_ty;
281
- let mut _to = None ;
281
+ let _to;
282
282
if let Some ( atpit_table) = & self . atpit_coercion_table {
283
283
if let TyKind :: OpaqueType ( opaque_ty_id, _) = to_ty. kind ( Interner ) {
284
284
if !matches ! (
285
285
from_ty. kind( Interner ) ,
286
286
TyKind :: InferenceVar ( ..) | TyKind :: OpaqueType ( ..)
287
287
) {
288
288
if let Some ( ty) = atpit_table. get ( opaque_ty_id) {
289
- _to = Some ( ty. clone ( ) ) ;
290
- to_ty = _to. as_ref ( ) . unwrap ( ) ;
289
+ _to = ty. clone ( ) ;
290
+ to_ty = & _to;
291
291
}
292
292
}
293
293
}
Original file line number Diff line number Diff line change @@ -301,13 +301,9 @@ impl<'a> TyLoweringContext<'a> {
301
301
TypeRef :: ImplTrait ( bounds) => {
302
302
match & self . impl_trait_mode {
303
303
ImplTraitLoweringState :: Opaque ( opaque_type_data) => {
304
- let ( origin, krate) = match self . resolver . generic_def ( ) {
305
- Some ( GenericDefId :: FunctionId ( f) ) => {
306
- ( Either :: Left ( f) , f. krate ( self . db . upcast ( ) ) )
307
- }
308
- Some ( GenericDefId :: TypeAliasId ( a) ) => {
309
- ( Either :: Right ( a) , a. krate ( self . db . upcast ( ) ) )
310
- }
304
+ let origin = match self . resolver . generic_def ( ) {
305
+ Some ( GenericDefId :: FunctionId ( it) ) => Either :: Left ( it) ,
306
+ Some ( GenericDefId :: TypeAliasId ( it) ) => Either :: Right ( it) ,
311
307
_ => panic ! (
312
308
"opaque impl trait lowering must be in function or type alias"
313
309
) ,
@@ -330,7 +326,7 @@ impl<'a> TyLoweringContext<'a> {
330
326
// away instead of two.
331
327
let actual_opaque_type_data = self
332
328
. with_debruijn ( DebruijnIndex :: INNERMOST , |ctx| {
333
- ctx. lower_impl_trait ( bounds, krate)
329
+ ctx. lower_impl_trait ( bounds, self . resolver . krate ( ) )
334
330
} ) ;
335
331
opaque_type_data. borrow_mut ( ) [ idx] = actual_opaque_type_data;
336
332
You can’t perform that action at this time.
0 commit comments