@@ -1315,43 +1315,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1315
1315
}
1316
1316
}
1317
1317
1318
- // Then try to coerce the previous expressions to the type of the new one.
1319
- // This requires ensuring there are no coercions applied to *any* of the
1320
- // previous expressions, other than noop reborrows (ignoring lifetimes).
1321
- for expr in exprs {
1322
- let expr = expr. as_coercion_site ( ) ;
1323
- let noop = match self . typeck_results . borrow ( ) . expr_adjustments ( expr) {
1324
- & [
1325
- Adjustment { kind : Adjust :: Deref ( _) , .. } ,
1326
- Adjustment { kind : Adjust :: Borrow ( AutoBorrow :: Ref ( mutbl_adj) ) , .. } ,
1327
- ] => {
1328
- match * self . node_ty ( expr. hir_id ) . kind ( ) {
1329
- ty:: Ref ( _, _, mt_orig) => {
1330
- let mutbl_adj: hir:: Mutability = mutbl_adj. into ( ) ;
1331
- // Reborrow that we can safely ignore, because
1332
- // the next adjustment can only be a Deref
1333
- // which will be merged into it.
1334
- mutbl_adj == mt_orig
1335
- }
1336
- _ => false ,
1337
- }
1338
- }
1339
- & [ Adjustment { kind : Adjust :: NeverToAny , .. } ] | & [ ] => true ,
1340
- _ => false ,
1341
- } ;
1342
-
1343
- if !noop {
1344
- debug ! (
1345
- "coercion::try_find_coercion_lub: older expression {:?} had adjustments, requiring LUB" ,
1346
- expr,
1347
- ) ;
1348
-
1349
- return Err ( self
1350
- . commit_if_ok ( |_| self . at ( cause, self . param_env ) . lub ( prev_ty, new_ty) )
1351
- . unwrap_err ( ) ) ;
1352
- }
1353
- }
1354
-
1355
1318
match self . commit_if_ok ( |_| coerce. coerce ( prev_ty, new_ty) ) {
1356
1319
Err ( _) => {
1357
1320
// Avoid giving strange errors on failed attempts.
0 commit comments