@@ -1481,14 +1481,6 @@ fn build_scope_drops<'tcx>(
14811481 block = next;
14821482 }
14831483 DropKind :: ForLint => {
1484- // If the operand has been moved, and we are not on an unwind
1485- // path, then don't generate the drop. (We only take this into
1486- // account for non-unwind paths so as not to disturb the
1487- // caching mechanism.)
1488- if scope. moved_locals . iter ( ) . any ( |& o| o == local) {
1489- continue ;
1490- }
1491-
14921484 // As in the `DropKind::Storage` case below:
14931485 // normally lint-related drops are not emitted for unwind,
14941486 // so we can just leave `unwind_to` unmodified, but in some
@@ -1500,6 +1492,14 @@ fn build_scope_drops<'tcx>(
15001492 unwind_to = unwind_drops. drops [ unwind_to] . next ;
15011493 }
15021494
1495+ // If the operand has been moved, and we are not on an unwind
1496+ // path, then don't generate the drop. (We only take this into
1497+ // account for non-unwind paths so as not to disturb the
1498+ // caching mechanism.)
1499+ if scope. moved_locals . iter ( ) . any ( |& o| o == local) {
1500+ continue ;
1501+ }
1502+
15031503 cfg. push ( block, Statement {
15041504 source_info,
15051505 kind : StatementKind :: BackwardIncompatibleDropHint {
@@ -1552,7 +1552,7 @@ impl<'a, 'tcx: 'a> Builder<'a, 'tcx> {
15521552 let mut unwind_indices = IndexVec :: from_elem_n ( unwind_target, 1 ) ;
15531553 for ( drop_idx, drop_node) in drops. drops . iter_enumerated ( ) . skip ( 1 ) {
15541554 match drop_node. data . kind {
1555- DropKind :: Storage => {
1555+ DropKind :: Storage | DropKind :: ForLint => {
15561556 if is_coroutine {
15571557 let unwind_drop = self
15581558 . scopes
@@ -1563,7 +1563,7 @@ impl<'a, 'tcx: 'a> Builder<'a, 'tcx> {
15631563 unwind_indices. push ( unwind_indices[ drop_node. next ] ) ;
15641564 }
15651565 }
1566- DropKind :: Value | DropKind :: ForLint => {
1566+ DropKind :: Value => {
15671567 let unwind_drop = self
15681568 . scopes
15691569 . unwind_drops
0 commit comments