diff --git a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs index ea484bd05878b..3c19635bc2cde 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs @@ -11,7 +11,7 @@ use rustc_middle::ty::adjustment::PointerCoercion; use rustc_middle::ty::cast::{CastTy, mir_cast_kind}; use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::{self, Ty, UpvarArgs}; -use rustc_span::{DUMMY_SP, Span, Spanned}; +use rustc_span::Span; use tracing::debug; use crate::builder::expr::as_place::PlaceBase; @@ -74,6 +74,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { NeedsTemporary::No ) ); + this.record_operand_moved(&value_operand); block.and(Rvalue::Repeat(value_operand, count)) } } @@ -219,6 +220,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }) .collect(); + for operand in fields.iter() { + this.record_operand_moved(operand); + } block.and(Rvalue::Aggregate(Box::new(AggregateKind::Array(el_ty)), fields)) } ExprKind::Tuple { ref fields } => { @@ -240,6 +244,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }) .collect(); + for operand in fields.iter() { + this.record_operand_moved(operand); + } block.and(Rvalue::Aggregate(Box::new(AggregateKind::Tuple), fields)) } ExprKind::Closure(ClosureExpr { @@ -342,6 +349,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { Box::new(AggregateKind::CoroutineClosure(closure_id.to_def_id(), args)) } }; + for operand in operands.iter() { + this.record_operand_moved(operand); + } block.and(Rvalue::Aggregate(result, operands)) } ExprKind::Assign { .. } | ExprKind::AssignOp { .. } => { @@ -424,6 +434,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { NeedsTemporary::No, ) ); + this.record_operand_moved(&operand); block.and(Rvalue::Use(operand, WithRetag::Yes)) } @@ -647,7 +658,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.diverge_from(block); block = success; } - this.record_operands_moved(&[Spanned { node: value_operand, span: DUMMY_SP }]); + this.record_operand_moved(&value_operand); } block.and(Rvalue::Aggregate(Box::new(AggregateKind::Array(elem_ty)), IndexVec::new())) } diff --git a/compiler/rustc_mir_build/src/builder/expr/into.rs b/compiler/rustc_mir_build/src/builder/expr/into.rs index ecc14fe887f24..d41d760fc4442 100644 --- a/compiler/rustc_mir_build/src/builder/expr/into.rs +++ b/compiler/rustc_mir_build/src/builder/expr/into.rs @@ -6,6 +6,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_hir as hir; use rustc_hir::lang_items::LangItem; +use rustc_index::IndexVec; use rustc_middle::mir::*; use rustc_middle::span_bug; use rustc_middle::thir::*; @@ -490,7 +491,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let success = this.cfg.start_new_block(); - this.record_operands_moved(&args); + for operand in args.iter() { + this.record_operand_moved(&operand.node); + } debug!("expr_into_dest: fn_span={:?}", fn_span); @@ -629,7 +632,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let variant = adt_def.variant(variant_index); let field_names = variant.fields.indices(); - let fields = match base { + let fields: IndexVec<_, _> = match base { AdtExprBase::None => { field_names.filter_map(|n| fields_map.get(&n).cloned()).collect() } @@ -694,6 +697,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { user_ty, active_field_index, )); + for operand in fields.iter() { + this.record_operand_moved(operand); + } this.cfg.push_assign( block, source_info, @@ -842,7 +848,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { debug_assert!(Category::of(&expr.kind) == Some(Category::Place)); let place = unpack!(block = this.as_place(block, expr_id)); - let rvalue = Rvalue::Use(this.consume_by_copy_or_move(place), WithRetag::Yes); + let operand = this.consume_by_copy_or_move(place); + this.record_operand_moved(&operand); + let rvalue = Rvalue::Use(operand, WithRetag::Yes); this.cfg.push_assign(block, source_info, destination, rvalue); block.unit() } @@ -868,6 +876,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block = this.as_operand(block, scope, value, LocalInfo::Boring, NeedsTemporary::No) ); + this.record_operand_moved(&value); let resume = this.cfg.start_new_block(); this.cfg.terminate( block, diff --git a/compiler/rustc_mir_build/src/builder/expr/stmt.rs b/compiler/rustc_mir_build/src/builder/expr/stmt.rs index 99e16d182a97d..fa8668f5f70bf 100644 --- a/compiler/rustc_mir_build/src/builder/expr/stmt.rs +++ b/compiler/rustc_mir_build/src/builder/expr/stmt.rs @@ -126,7 +126,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }) .collect(); - this.record_operands_moved(&args); + for operand in args.iter() { + this.record_operand_moved(&operand.node); + } debug!("expr_into_dest: fn_span={:?}", fn_span); diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 932e4af130459..aac1b4482126a 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -86,6 +86,7 @@ use std::mem; use interpret::ErrorHandled; use rustc_data_structures::fx::FxHashMap; use rustc_hir::HirId; +use rustc_index::bit_set::GrowableBitSet; use rustc_index::{IndexSlice, IndexVec}; use rustc_middle::middle::region; use rustc_middle::mir::{self, *}; @@ -137,7 +138,7 @@ struct Scope { /// end of the vector (top of the stack) first. drops: Vec, - moved_locals: Vec, + moved_locals: GrowableBitSet, /// The drop index that will drop everything in and below this scope on an /// unwind path. @@ -494,7 +495,7 @@ impl<'tcx> Scopes<'tcx> { source_scope: vis_scope, region_scope, drops: vec![], - moved_locals: vec![], + moved_locals: GrowableBitSet::new_empty(), cached_unwind_block: None, cached_coroutine_drop_block: None, }); @@ -1522,7 +1523,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { self.schedule_drop(span, region_scope, local, DropKind::ForLint); } - /// Indicates that the "local operand" stored in `local` is + /// Indicates that the "local operand" stored in `operand` is /// *moved* at some point during execution (see `local_scope` for /// more information about what a "local operand" is -- in short, /// it's an intermediate operand created as part of preparing some @@ -1558,26 +1559,24 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { /// spurious borrow-check errors -- the problem, ironically, is /// not the `DROP(_X)` itself, but the (spurious) unwind pathways /// that it creates. See #64391 for an example. - pub(crate) fn record_operands_moved(&mut self, operands: &[Spanned>]) { + #[instrument(level = "debug", skip(self))] + pub(crate) fn record_operand_moved(&mut self, operand: &Operand<'tcx>) { let local_scope = self.local_scope(); let scope = self.scopes.scopes.last_mut().unwrap(); - - assert_eq!(scope.region_scope, local_scope, "local scope is not the topmost scope!",); + assert_eq!(scope.region_scope, local_scope, "local scope is not the topmost scope!"); // look for moves of a local variable, like `MOVE(_X)` - let locals_moved = operands.iter().flat_map(|operand| match operand.node { + let local_moved = match operand { Operand::Copy(_) | Operand::Constant(_) | Operand::RuntimeChecks(_) => None, Operand::Move(place) => place.as_local(), - }); + }; - for local in locals_moved { + if let Some(local) = local_moved { // check if we have a Drop for this operand and -- if so // -- add it to the list of moved operands. Note that this // local might not have been an operand created for this // call, it could come from other places too. - if scope.drops.iter().any(|drop| drop.local == local && drop.kind == DropKind::Value) { - scope.moved_locals.push(local); - } + scope.moved_locals.insert(local); } } @@ -1878,7 +1877,7 @@ where // path, then don't generate the drop. (We only take this into // account for non-unwind paths so as not to disturb the // caching mechanism.) - if scope.moved_locals.contains(&local) { + if scope.moved_locals.contains(local) { continue; } @@ -1922,7 +1921,7 @@ where // path, then don't generate the drop. (We only take this into // account for non-unwind paths so as not to disturb the // caching mechanism.) - if scope.moved_locals.contains(&local) { + if scope.moved_locals.contains(local) { continue; } diff --git a/tests/mir-opt/box_partial_move.maybe_move.ElaborateDrops.diff b/tests/mir-opt/box_partial_move.maybe_move.ElaborateDrops.diff index f090795e88656..0a672d1832a22 100644 --- a/tests/mir-opt/box_partial_move.maybe_move.ElaborateDrops.diff +++ b/tests/mir-opt/box_partial_move.maybe_move.ElaborateDrops.diff @@ -19,7 +19,7 @@ + _5 = const true; StorageLive(_3); _3 = copy _1; - switchInt(move _3) -> [0: bb3, otherwise: bb1]; + switchInt(move _3) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -27,68 +27,58 @@ + _5 = const false; _4 = move (*_2); _0 = Option::::Some(move _4); -- drop(_4) -> [return: bb2, unwind: bb6]; -+ goto -> bb2; - } - - bb2: { StorageDead(_4); - goto -> bb4; + goto -> bb3; } - bb3: { + bb2: { _0 = Option::::None; - goto -> bb4; + goto -> bb3; } - bb4: { + bb3: { StorageDead(_3); -- drop(_2) -> [return: bb5, unwind continue]; -+ goto -> bb14; +- drop(_2) -> [return: bb4, unwind continue]; ++ goto -> bb12; } - bb5: { + bb4: { return; - } - - bb6 (cleanup): { -- drop(_2) -> [return: bb7, unwind terminate(cleanup)]; -+ goto -> bb7; - } - - bb7 (cleanup): { - resume; + } + -+ bb8: { -+ goto -> bb5; ++ bb5 (cleanup): { ++ resume; + } + -+ bb9: { ++ bb6: { ++ goto -> bb4; ++ } ++ ++ bb7: { + _6 = &mut _2; -+ _7 = as Drop>::drop(move _6) -> [return: bb8, unwind: bb7]; ++ _7 = as Drop>::drop(move _6) -> [return: bb6, unwind: bb5]; + } + -+ bb10 (cleanup): { ++ bb8 (cleanup): { + _8 = &mut _2; -+ _9 = as Drop>::drop(move _8) -> [return: bb7, unwind terminate(cleanup)]; ++ _9 = as Drop>::drop(move _8) -> [return: bb5, unwind terminate(cleanup)]; + } + -+ bb11: { -+ goto -> bb13; ++ bb9: { ++ goto -> bb11; + } + -+ bb12: { -+ drop((*_10)) -> [return: bb9, unwind: bb10]; ++ bb10: { ++ drop((*_10)) -> [return: bb7, unwind: bb8]; + } + -+ bb13: { -+ switchInt(copy _5) -> [0: bb9, otherwise: bb12]; ++ bb11: { ++ switchInt(copy _5) -> [0: bb7, otherwise: bb10]; + } + -+ bb14: { ++ bb12: { + _10 = copy ((_2.0: std::ptr::Unique).0: std::ptr::NonNull) as *const std::string::String (Transmute); -+ goto -> bb11; ++ goto -> bb9; } } diff --git a/tests/mir-opt/building/fallible_struct_drop.build.ElaborateDrops.diff b/tests/mir-opt/building/fallible_struct_drop.build.ElaborateDrops.diff index d2a4f5025bd45..4427da664087b 100644 --- a/tests/mir-opt/building/fallible_struct_drop.build.ElaborateDrops.diff +++ b/tests/mir-opt/building/fallible_struct_drop.build.ElaborateDrops.diff @@ -129,7 +129,7 @@ bb1: { StorageDead(_6); - _4 = as Try>::branch(move _5) -> [return: bb2, unwind: bb91]; + _4 = as Try>::branch(move _5) -> [return: bb2, unwind: bb80]; } bb2: { @@ -148,7 +148,7 @@ StorageLive(_12); _12 = move ((_4 as Continue).0: std::string::String); _3 = move _12; -- drop(_12) -> [return: bb7, unwind: bb90]; +- drop(_12) -> [return: bb7, unwind: bb79]; + goto -> bb7; } @@ -157,7 +157,7 @@ _9 = copy ((_4 as Break).0: std::result::Result); StorageLive(_11); _11 = copy _9; - _0 = as FromResidual>>::from_residual(move _11) -> [return: bb6, unwind: bb90]; + _0 = as FromResidual>>::from_residual(move _11) -> [return: bb6, unwind: bb79]; } bb6: { @@ -165,7 +165,7 @@ StorageDead(_9); StorageDead(_3); StorageDead(_2); - goto -> bb60; + goto -> bb54; } bb7: { @@ -178,12 +178,12 @@ _17 = copy _1; _16 = BitXor(move _17, const 1_u64); StorageDead(_17); - _15 = make_one(move _16) -> [return: bb8, unwind: bb89]; + _15 = make_one(move _16) -> [return: bb8, unwind: bb78]; } bb8: { StorageDead(_16); - _14 = as Try>::branch(move _15) -> [return: bb9, unwind: bb88]; + _14 = as Try>::branch(move _15) -> [return: bb9, unwind: bb77]; } bb9: { @@ -198,7 +198,7 @@ StorageLive(_22); _22 = move ((_14 as Continue).0: std::string::String); _13 = move _22; -- drop(_22) -> [return: bb13, unwind: bb86]; +- drop(_22) -> [return: bb13, unwind: bb75]; + goto -> bb13; } @@ -207,14 +207,14 @@ _19 = copy ((_14 as Break).0: std::result::Result); StorageLive(_21); _21 = copy _19; - _0 = as FromResidual>>::from_residual(move _21) -> [return: bb12, unwind: bb86]; + _0 = as FromResidual>>::from_residual(move _21) -> [return: bb12, unwind: bb75]; } bb12: { StorageDead(_21); StorageDead(_19); StorageDead(_13); - drop(_3) -> [return: bb57, unwind: bb87]; + drop(_3) -> [return: bb51, unwind: bb76]; } bb13: { @@ -227,12 +227,12 @@ _27 = copy _1; _26 = BitXor(move _27, const 2_u64); StorageDead(_27); - _25 = make_one(move _26) -> [return: bb14, unwind: bb85]; + _25 = make_one(move _26) -> [return: bb14, unwind: bb74]; } bb14: { StorageDead(_26); - _24 = as Try>::branch(move _25) -> [return: bb15, unwind: bb84]; + _24 = as Try>::branch(move _25) -> [return: bb15, unwind: bb73]; } bb15: { @@ -247,7 +247,7 @@ StorageLive(_32); _32 = move ((_24 as Continue).0: std::string::String); _23 = move _32; -- drop(_32) -> [return: bb19, unwind: bb81]; +- drop(_32) -> [return: bb19, unwind: bb70]; + goto -> bb19; } @@ -256,14 +256,14 @@ _29 = copy ((_24 as Break).0: std::result::Result); StorageLive(_31); _31 = copy _29; - _0 = as FromResidual>>::from_residual(move _31) -> [return: bb18, unwind: bb81]; + _0 = as FromResidual>>::from_residual(move _31) -> [return: bb18, unwind: bb70]; } bb18: { StorageDead(_31); StorageDead(_29); StorageDead(_23); - drop(_13) -> [return: bb53, unwind: bb82]; + drop(_13) -> [return: bb47, unwind: bb71]; } bb19: { @@ -276,12 +276,12 @@ _37 = copy _1; _36 = BitXor(move _37, const 3_u64); StorageDead(_37); - _35 = make_one(move _36) -> [return: bb20, unwind: bb80]; + _35 = make_one(move _36) -> [return: bb20, unwind: bb69]; } bb20: { StorageDead(_36); - _34 = as Try>::branch(move _35) -> [return: bb21, unwind: bb79]; + _34 = as Try>::branch(move _35) -> [return: bb21, unwind: bb68]; } bb21: { @@ -296,7 +296,7 @@ StorageLive(_42); _42 = move ((_34 as Continue).0: std::string::String); _33 = move _42; -- drop(_42) -> [return: bb25, unwind: bb75]; +- drop(_42) -> [return: bb25, unwind: bb64]; + goto -> bb25; } @@ -305,14 +305,14 @@ _39 = copy ((_34 as Break).0: std::result::Result); StorageLive(_41); _41 = copy _39; - _0 = as FromResidual>>::from_residual(move _41) -> [return: bb24, unwind: bb75]; + _0 = as FromResidual>>::from_residual(move _41) -> [return: bb24, unwind: bb64]; } bb24: { StorageDead(_41); StorageDead(_39); StorageDead(_33); - drop(_23) -> [return: bb48, unwind: bb76]; + drop(_23) -> [return: bb42, unwind: bb65]; } bb25: { @@ -325,12 +325,12 @@ _47 = copy _1; _46 = BitXor(move _47, const 4_u64); StorageDead(_47); - _45 = make_one(move _46) -> [return: bb26, unwind: bb74]; + _45 = make_one(move _46) -> [return: bb26, unwind: bb63]; } bb26: { StorageDead(_46); - _44 = as Try>::branch(move _45) -> [return: bb27, unwind: bb73]; + _44 = as Try>::branch(move _45) -> [return: bb27, unwind: bb62]; } bb27: { @@ -344,7 +344,7 @@ StorageLive(_52); _52 = move ((_44 as Continue).0: std::string::String); _43 = move _52; -- drop(_52) -> [return: bb31, unwind: bb68]; +- drop(_52) -> [return: bb31, unwind: bb57]; + goto -> bb31; } @@ -353,228 +353,221 @@ _49 = copy ((_44 as Break).0: std::result::Result); StorageLive(_51); _51 = copy _49; - _0 = as FromResidual>>::from_residual(move _51) -> [return: bb30, unwind: bb68]; + _0 = as FromResidual>>::from_residual(move _51) -> [return: bb30, unwind: bb57]; } bb30: { StorageDead(_51); StorageDead(_49); StorageDead(_43); - drop(_33) -> [return: bb43, unwind: bb69]; + drop(_33) -> [return: bb37, unwind: bb58]; } bb31: { StorageDead(_52); _2 = Big { f0: move _3, f1: move _13, f2: move _23, f3: move _33, f4: move _43 }; -- drop(_43) -> [return: bb32, unwind: bb63]; -+ goto -> bb32; - } - - bb32: { StorageDead(_43); -- drop(_33) -> [return: bb33, unwind: bb64]; -+ goto -> bb33; - } - - bb33: { StorageDead(_33); -- drop(_23) -> [return: bb34, unwind: bb65]; -+ goto -> bb34; - } - - bb34: { StorageDead(_23); -- drop(_13) -> [return: bb35, unwind: bb66]; -+ goto -> bb35; - } - - bb35: { StorageDead(_13); -- drop(_3) -> [return: bb36, unwind: bb67]; -+ goto -> bb36; - } - - bb36: { StorageDead(_3); _0 = Result::::Ok(move _2); -- drop(_2) -> [return: bb37, unwind: bb72]; -+ goto -> bb37; - } - - bb37: { StorageDead(_2); -- drop(_44) -> [return: bb38, unwind: bb78]; -+ goto -> bb93; +- drop(_44) -> [return: bb32, unwind: bb67]; ++ goto -> bb82; } - bb38: { + bb32: { StorageDead(_44); -- drop(_34) -> [return: bb39, unwind: bb83]; -+ goto -> bb94; +- drop(_34) -> [return: bb33, unwind: bb72]; ++ goto -> bb83; } - bb39: { + bb33: { + _53 = const false; StorageDead(_34); -- drop(_24) -> [return: bb40, unwind: bb87]; -+ goto -> bb95; +- drop(_24) -> [return: bb34, unwind: bb76]; ++ goto -> bb84; } - bb40: { + bb34: { + _54 = const false; StorageDead(_24); -- drop(_14) -> [return: bb41, unwind: bb90]; -+ goto -> bb96; +- drop(_14) -> [return: bb35, unwind: bb79]; ++ goto -> bb85; } - bb41: { + bb35: { + _55 = const false; StorageDead(_14); -- drop(_4) -> [return: bb42, unwind continue]; -+ goto -> bb97; +- drop(_4) -> [return: bb36, unwind continue]; ++ goto -> bb86; } - bb42: { + bb36: { + _56 = const false; StorageDead(_4); - goto -> bb62; + goto -> bb56; } - bb43: { + bb37: { StorageDead(_33); - drop(_23) -> [return: bb44, unwind: bb70]; + drop(_23) -> [return: bb38, unwind: bb59]; } - bb44: { + bb38: { StorageDead(_23); - drop(_13) -> [return: bb45, unwind: bb71]; + drop(_13) -> [return: bb39, unwind: bb60]; } - bb45: { + bb39: { StorageDead(_13); - drop(_3) -> [return: bb46, unwind: bb72]; + drop(_3) -> [return: bb40, unwind: bb61]; } - bb46: { + bb40: { StorageDead(_3); StorageDead(_2); -- drop(_44) -> [return: bb47, unwind: bb78]; -+ goto -> bb98; +- drop(_44) -> [return: bb41, unwind: bb67]; ++ goto -> bb87; } - bb47: { + bb41: { StorageDead(_44); - goto -> bb51; + goto -> bb45; } - bb48: { + bb42: { StorageDead(_23); - drop(_13) -> [return: bb49, unwind: bb77]; + drop(_13) -> [return: bb43, unwind: bb66]; } - bb49: { + bb43: { StorageDead(_13); - drop(_3) -> [return: bb50, unwind: bb78]; + drop(_3) -> [return: bb44, unwind: bb67]; } - bb50: { + bb44: { StorageDead(_3); StorageDead(_2); - goto -> bb51; + goto -> bb45; } - bb51: { -- drop(_34) -> [return: bb52, unwind: bb83]; -+ goto -> bb99; + bb45: { +- drop(_34) -> [return: bb46, unwind: bb72]; ++ goto -> bb88; } - bb52: { + bb46: { + _53 = const false; StorageDead(_34); - goto -> bb55; + goto -> bb49; } - bb53: { + bb47: { StorageDead(_13); - drop(_3) -> [return: bb54, unwind: bb83]; + drop(_3) -> [return: bb48, unwind: bb72]; } - bb54: { + bb48: { StorageDead(_3); StorageDead(_2); - goto -> bb55; + goto -> bb49; } - bb55: { -- drop(_24) -> [return: bb56, unwind: bb87]; -+ goto -> bb100; + bb49: { +- drop(_24) -> [return: bb50, unwind: bb76]; ++ goto -> bb89; } - bb56: { + bb50: { + _54 = const false; StorageDead(_24); - goto -> bb58; + goto -> bb52; } - bb57: { + bb51: { StorageDead(_3); StorageDead(_2); - goto -> bb58; + goto -> bb52; } - bb58: { -- drop(_14) -> [return: bb59, unwind: bb90]; -+ goto -> bb101; + bb52: { +- drop(_14) -> [return: bb53, unwind: bb79]; ++ goto -> bb90; } - bb59: { + bb53: { + _55 = const false; StorageDead(_14); - goto -> bb60; + goto -> bb54; } - bb60: { -- drop(_4) -> [return: bb61, unwind continue]; -+ goto -> bb102; + bb54: { +- drop(_4) -> [return: bb55, unwind continue]; ++ goto -> bb91; } - bb61: { + bb55: { + _56 = const false; StorageDead(_4); - goto -> bb62; + goto -> bb56; } - bb62: { + bb56: { return; } + bb57 (cleanup): { + drop(_33) -> [return: bb58, unwind terminate(cleanup)]; + } + + bb58 (cleanup): { + drop(_23) -> [return: bb59, unwind terminate(cleanup)]; + } + + bb59 (cleanup): { + drop(_13) -> [return: bb60, unwind terminate(cleanup)]; + } + + bb60 (cleanup): { + drop(_3) -> [return: bb61, unwind terminate(cleanup)]; + } + + bb61 (cleanup): { +- drop(_44) -> [return: bb67, unwind terminate(cleanup)]; ++ goto -> bb67; + } + + bb62 (cleanup): { +- drop(_45) -> [return: bb63, unwind terminate(cleanup)]; ++ goto -> bb63; + } + bb63 (cleanup): { -- drop(_33) -> [return: bb64, unwind terminate(cleanup)]; -+ goto -> bb64; + drop(_33) -> [return: bb64, unwind terminate(cleanup)]; } bb64 (cleanup): { -- drop(_23) -> [return: bb65, unwind terminate(cleanup)]; -+ goto -> bb65; + drop(_23) -> [return: bb65, unwind terminate(cleanup)]; } bb65 (cleanup): { -- drop(_13) -> [return: bb66, unwind terminate(cleanup)]; -+ goto -> bb66; + drop(_13) -> [return: bb66, unwind terminate(cleanup)]; } bb66 (cleanup): { -- drop(_3) -> [return: bb67, unwind terminate(cleanup)]; -+ goto -> bb67; + drop(_3) -> [return: bb67, unwind terminate(cleanup)]; } bb67 (cleanup): { -- drop(_2) -> [return: bb72, unwind terminate(cleanup)]; +- drop(_34) -> [return: bb72, unwind terminate(cleanup)]; + goto -> bb72; } bb68 (cleanup): { - drop(_33) -> [return: bb69, unwind terminate(cleanup)]; +- drop(_35) -> [return: bb69, unwind terminate(cleanup)]; ++ goto -> bb69; } bb69 (cleanup): { @@ -590,137 +583,89 @@ } bb72 (cleanup): { -- drop(_44) -> [return: bb78, unwind terminate(cleanup)]; -+ goto -> bb78; +- drop(_24) -> [return: bb76, unwind terminate(cleanup)]; ++ goto -> bb76; } bb73 (cleanup): { -- drop(_45) -> [return: bb74, unwind terminate(cleanup)]; +- drop(_25) -> [return: bb74, unwind terminate(cleanup)]; + goto -> bb74; } bb74 (cleanup): { - drop(_33) -> [return: bb75, unwind terminate(cleanup)]; + drop(_13) -> [return: bb75, unwind terminate(cleanup)]; } bb75 (cleanup): { - drop(_23) -> [return: bb76, unwind terminate(cleanup)]; + drop(_3) -> [return: bb76, unwind terminate(cleanup)]; } bb76 (cleanup): { - drop(_13) -> [return: bb77, unwind terminate(cleanup)]; +- drop(_14) -> [return: bb79, unwind terminate(cleanup)]; ++ goto -> bb79; } bb77 (cleanup): { - drop(_3) -> [return: bb78, unwind terminate(cleanup)]; +- drop(_15) -> [return: bb78, unwind terminate(cleanup)]; ++ goto -> bb78; } bb78 (cleanup): { -- drop(_34) -> [return: bb83, unwind terminate(cleanup)]; -+ goto -> bb83; + drop(_3) -> [return: bb79, unwind terminate(cleanup)]; } bb79 (cleanup): { -- drop(_35) -> [return: bb80, unwind terminate(cleanup)]; -+ goto -> bb80; +- drop(_4) -> [return: bb81, unwind terminate(cleanup)]; ++ goto -> bb81; } bb80 (cleanup): { - drop(_23) -> [return: bb81, unwind terminate(cleanup)]; +- drop(_5) -> [return: bb81, unwind terminate(cleanup)]; ++ goto -> bb81; } bb81 (cleanup): { - drop(_13) -> [return: bb82, unwind terminate(cleanup)]; - } - - bb82 (cleanup): { - drop(_3) -> [return: bb83, unwind terminate(cleanup)]; - } - - bb83 (cleanup): { -- drop(_24) -> [return: bb87, unwind terminate(cleanup)]; -+ goto -> bb87; - } - - bb84 (cleanup): { -- drop(_25) -> [return: bb85, unwind terminate(cleanup)]; -+ goto -> bb85; - } - - bb85 (cleanup): { - drop(_13) -> [return: bb86, unwind terminate(cleanup)]; - } - - bb86 (cleanup): { - drop(_3) -> [return: bb87, unwind terminate(cleanup)]; - } - - bb87 (cleanup): { -- drop(_14) -> [return: bb90, unwind terminate(cleanup)]; -+ goto -> bb90; - } - - bb88 (cleanup): { -- drop(_15) -> [return: bb89, unwind terminate(cleanup)]; -+ goto -> bb89; - } - - bb89 (cleanup): { - drop(_3) -> [return: bb90, unwind terminate(cleanup)]; - } - - bb90 (cleanup): { -- drop(_4) -> [return: bb92, unwind terminate(cleanup)]; -+ goto -> bb92; - } - - bb91 (cleanup): { -- drop(_5) -> [return: bb92, unwind terminate(cleanup)]; -+ goto -> bb92; - } - - bb92 (cleanup): { resume; + } + -+ bb93: { -+ goto -> bb38; ++ bb82: { ++ goto -> bb32; + } + -+ bb94: { -+ goto -> bb39; ++ bb83: { ++ goto -> bb33; + } + -+ bb95: { -+ goto -> bb40; ++ bb84: { ++ goto -> bb34; + } + -+ bb96: { -+ goto -> bb41; ++ bb85: { ++ goto -> bb35; + } + -+ bb97: { -+ goto -> bb42; ++ bb86: { ++ goto -> bb36; + } + -+ bb98: { -+ goto -> bb47; ++ bb87: { ++ goto -> bb41; + } + -+ bb99: { -+ goto -> bb52; ++ bb88: { ++ goto -> bb46; + } + -+ bb100: { -+ goto -> bb56; ++ bb89: { ++ goto -> bb50; + } + -+ bb101: { -+ goto -> bb59; ++ bb90: { ++ goto -> bb53; + } + -+ bb102: { -+ goto -> bb61; ++ bb91: { ++ goto -> bb55; } } diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.CleanupPostBorrowck.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.CleanupPostBorrowck.after.mir index 17756938b889d..1ae0e19d94d79 100644 --- a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.CleanupPostBorrowck.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.CleanupPostBorrowck.after.mir @@ -16,53 +16,45 @@ fn move_out_by_subslice() -> () { bb0: { StorageLive(_1); StorageLive(_2); - _2 = Box::::new(const 1_i32) -> [return: bb1, unwind: bb9]; + _2 = Box::::new(const 1_i32) -> [return: bb1, unwind: bb7]; } bb1: { StorageLive(_3); - _3 = Box::::new(const 2_i32) -> [return: bb2, unwind: bb8]; + _3 = Box::::new(const 2_i32) -> [return: bb2, unwind: bb6]; } bb2: { _1 = [move _2, move _3]; - drop(_3) -> [return: bb3, unwind: bb8]; - } - - bb3: { StorageDead(_3); - drop(_2) -> [return: bb4, unwind: bb9]; - } - - bb4: { StorageDead(_2); nop; PlaceMention(_1); StorageLive(_4); _4 = move _1[0..2]; _0 = const (); - drop(_4) -> [return: bb5, unwind: bb7]; + drop(_4) -> [return: bb3, unwind: bb5]; } - bb5: { + bb3: { StorageDead(_4); - drop(_1) -> [return: bb6, unwind: bb9]; + drop(_1) -> [return: bb4, unwind: bb7]; } - bb6: { + bb4: { StorageDead(_1); return; } - bb7 (cleanup): { - drop(_1) -> [return: bb9, unwind terminate(cleanup)]; + bb5 (cleanup): { + drop(_1) -> [return: bb7, unwind terminate(cleanup)]; } - bb8 (cleanup): { - drop(_2) -> [return: bb9, unwind terminate(cleanup)]; + bb6 (cleanup): { + drop(_2) -> [return: bb7, unwind terminate(cleanup)]; } - bb9 (cleanup): { + bb7 (cleanup): { resume; } } diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.CleanupPostBorrowck.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.CleanupPostBorrowck.after.mir index 79e0f0af0dbc8..8c082ce6bf11c 100644 --- a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.CleanupPostBorrowck.after.mir +++ b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.CleanupPostBorrowck.after.mir @@ -16,53 +16,45 @@ fn move_out_from_end() -> () { bb0: { StorageLive(_1); StorageLive(_2); - _2 = Box::::new(const 1_i32) -> [return: bb1, unwind: bb9]; + _2 = Box::::new(const 1_i32) -> [return: bb1, unwind: bb7]; } bb1: { StorageLive(_3); - _3 = Box::::new(const 2_i32) -> [return: bb2, unwind: bb8]; + _3 = Box::::new(const 2_i32) -> [return: bb2, unwind: bb6]; } bb2: { _1 = [move _2, move _3]; - drop(_3) -> [return: bb3, unwind: bb8]; - } - - bb3: { StorageDead(_3); - drop(_2) -> [return: bb4, unwind: bb9]; - } - - bb4: { StorageDead(_2); nop; PlaceMention(_1); StorageLive(_4); _4 = move _1[1 of 2]; _0 = const (); - drop(_4) -> [return: bb5, unwind: bb7]; + drop(_4) -> [return: bb3, unwind: bb5]; } - bb5: { + bb3: { StorageDead(_4); - drop(_1) -> [return: bb6, unwind: bb9]; + drop(_1) -> [return: bb4, unwind: bb7]; } - bb6: { + bb4: { StorageDead(_1); return; } - bb7 (cleanup): { - drop(_1) -> [return: bb9, unwind terminate(cleanup)]; + bb5 (cleanup): { + drop(_1) -> [return: bb7, unwind terminate(cleanup)]; } - bb8 (cleanup): { - drop(_2) -> [return: bb9, unwind terminate(cleanup)]; + bb6 (cleanup): { + drop(_2) -> [return: bb7, unwind terminate(cleanup)]; } - bb9 (cleanup): { + bb7 (cleanup): { resume; } } diff --git a/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.ElaborateDrops.diff b/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.ElaborateDrops.diff index dd65409f0db13..d67c57bf295ec 100644 --- a/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.ElaborateDrops.diff +++ b/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.ElaborateDrops.diff @@ -234,17 +234,7 @@ StorageLive(_7); _7 = AsyncInt(const 2_i32); _5 = [move _6, move _7]; -- drop(_7) -> [return: bb1, unwind: bb62, drop: bb38]; -+ goto -> bb1; - } - - bb1: { StorageDead(_7); -- drop(_6) -> [return: bb2, unwind: bb63, drop: bb39]; -+ goto -> bb2; - } - - bb2: { StorageDead(_6); StorageLive(_8); StorageLive(_9); @@ -252,17 +242,7 @@ StorageLive(_10); _10 = AsyncInt(const 4_i32); _8 = AsyncStruct { i: const 3_i32, a: move _10, b: move _9 }; -- drop(_10) -> [return: bb3, unwind: bb59, drop: bb35]; -+ goto -> bb3; - } - - bb3: { StorageDead(_10); -- drop(_9) -> [return: bb4, unwind: bb60, drop: bb36]; -+ goto -> bb4; - } - - bb4: { StorageDead(_9); StorageLive(_11); StorageLive(_12); @@ -272,41 +252,21 @@ StorageLive(_14); _14 = AsyncInt(const 9_i32); _11 = SyncThenAsync { i: const 6_i32, a: move _12, b: move _13, c: move _14 }; -- drop(_14) -> [return: bb5, unwind: bb55, drop: bb31]; -+ goto -> bb5; - } - - bb5: { StorageDead(_14); -- drop(_13) -> [return: bb6, unwind: bb56]; -+ goto -> bb6; - } - - bb6: { StorageDead(_13); -- drop(_12) -> [return: bb7, unwind: bb57, drop: bb33]; -+ goto -> bb7; - } - - bb7: { StorageDead(_12); StorageLive(_15); StorageLive(_16); _16 = AsyncInt(const 10_i32); _15 = AsyncEnum::A(move _16); -- drop(_16) -> [return: bb8, unwind: bb53, drop: bb29]; -+ goto -> bb8; - } - - bb8: { StorageDead(_16); StorageLive(_17); StorageLive(_18); _18 = AsyncInt(const 11_i32); - _17 = ManuallyDrop::::new(move _18) -> [return: bb9, unwind: bb50]; + _17 = ManuallyDrop::::new(move _18) -> [return: bb1, unwind: bb34]; } - bb9: { + bb1: { StorageDead(_18); StorageLive(_19); _19 = AsyncInt(const 12_i32); @@ -327,1331 +287,1222 @@ StorageLive(_26); _26 = {closure@$DIR/async_drop.rs:78:27: 78:35} { foo: move _25 }; _0 = const (); -- drop(_26) -> [return: bb10, unwind: bb44, drop: bb23]; -+ goto -> bb103; +- drop(_26) -> [return: bb2, unwind: bb28, drop: bb15]; ++ goto -> bb75; } - bb10: { + bb2: { StorageDead(_26); -- drop(_25) -> [return: bb11, unwind: bb45, drop: bb24]; -+ goto -> bb11; +- drop(_25) -> [return: bb3, unwind: bb29, drop: bb16]; ++ goto -> bb3; } - bb11: { + bb3: { StorageDead(_25); -- drop(_24) -> [return: bb12, unwind: bb46, drop: bb25]; -+ goto -> bb123; +- drop(_24) -> [return: bb4, unwind: bb30, drop: bb17]; ++ goto -> bb95; } - bb12: { + bb4: { StorageDead(_24); -- drop(_23) -> [return: bb13, unwind: bb47, drop: bb26]; -+ goto -> bb13; +- drop(_23) -> [return: bb5, unwind: bb31, drop: bb18]; ++ goto -> bb5; } - bb13: { + bb5: { StorageDead(_23); -- drop(_20) -> [return: bb14, unwind: bb48, drop: bb27]; -+ goto -> bb143; +- drop(_20) -> [return: bb6, unwind: bb32, drop: bb19]; ++ goto -> bb115; } - bb14: { + bb6: { StorageDead(_20); -- drop(_19) -> [return: bb15, unwind: bb49, drop: bb28]; -+ goto -> bb163; +- drop(_19) -> [return: bb7, unwind: bb33, drop: bb20]; ++ goto -> bb135; } - bb15: { + bb7: { StorageDead(_19); StorageDead(_17); -- drop(_15) -> [return: bb16, unwind: bb54, drop: bb30]; -+ goto -> bb183; +- drop(_15) -> [return: bb8, unwind: bb37, drop: bb21]; ++ goto -> bb155; } - bb16: { + bb8: { StorageDead(_15); -- drop(_11) -> [return: bb17, unwind: bb58, drop: bb34]; -+ goto -> bb203; +- drop(_11) -> [return: bb9, unwind: bb38, drop: bb22]; ++ goto -> bb175; } - bb17: { + bb9: { StorageDead(_11); -- drop(_8) -> [return: bb18, unwind: bb61, drop: bb37]; -+ goto -> bb223; +- drop(_8) -> [return: bb10, unwind: bb39, drop: bb23]; ++ goto -> bb195; } - bb18: { + bb10: { StorageDead(_8); -- drop(_5) -> [return: bb19, unwind: bb64, drop: bb40]; -+ goto -> bb243; +- drop(_5) -> [return: bb11, unwind: bb40, drop: bb24]; ++ goto -> bb215; } - bb19: { + bb11: { StorageDead(_5); -- drop(_4) -> [return: bb20, unwind: bb65, drop: bb41]; -+ goto -> bb263; +- drop(_4) -> [return: bb12, unwind: bb41, drop: bb25]; ++ goto -> bb235; } - bb20: { + bb12: { StorageDead(_4); - drop(_3) -> [return: bb21, unwind: bb66]; + drop(_3) -> [return: bb13, unwind: bb42]; } - bb21: { + bb13: { StorageDead(_3); -- drop(_1) -> [return: bb22, drop: bb43, unwind continue]; -+ drop(_1) -> [return: bb22, unwind: bb67]; +- drop(_1) -> [return: bb14, drop: bb27, unwind continue]; ++ drop(_1) -> [return: bb14, unwind: bb43]; } - bb22: { + bb14: { return; } - bb23: { + bb15: { StorageDead(_26); -- drop(_25) -> [return: bb24, unwind: bb68]; -+ goto -> bb24; +- drop(_25) -> [return: bb16, unwind: bb44]; ++ goto -> bb16; } - bb24: { + bb16: { StorageDead(_25); -- drop(_24) -> [return: bb25, unwind: bb69]; -+ goto -> bb25; +- drop(_24) -> [return: bb17, unwind: bb45]; ++ goto -> bb17; } - bb25: { + bb17: { StorageDead(_24); -- drop(_23) -> [return: bb26, unwind: bb70]; -+ goto -> bb26; +- drop(_23) -> [return: bb18, unwind: bb46]; ++ goto -> bb18; } - bb26: { + bb18: { StorageDead(_23); -- drop(_20) -> [return: bb27, unwind: bb71]; -+ goto -> bb27; +- drop(_20) -> [return: bb19, unwind: bb47]; ++ goto -> bb19; } - bb27: { + bb19: { StorageDead(_20); -- drop(_19) -> [return: bb28, unwind: bb72]; -+ goto -> bb28; +- drop(_19) -> [return: bb20, unwind: bb48]; ++ goto -> bb20; } - bb28: { + bb20: { StorageDead(_19); StorageDead(_17); -- drop(_15) -> [return: bb30, unwind: bb73]; -+ goto -> bb30; +- drop(_15) -> [return: bb21, unwind: bb49]; ++ goto -> bb21; } - bb29: { - StorageDead(_16); - goto -> bb30; - } - - bb30: { + bb21: { StorageDead(_15); -- drop(_11) -> [return: bb34, unwind: bb76]; -+ goto -> bb34; - } - - bb31: { - StorageDead(_14); -- drop(_13) -> [return: bb32, unwind: bb74]; -+ goto -> bb32; +- drop(_11) -> [return: bb22, unwind: bb50]; ++ goto -> bb22; } - bb32: { - StorageDead(_13); -- drop(_12) -> [return: bb33, unwind: bb75]; -+ goto -> bb33; - } - - bb33: { - StorageDead(_12); - goto -> bb34; - } - - bb34: { + bb22: { StorageDead(_11); -- drop(_8) -> [return: bb37, unwind: bb78]; -+ goto -> bb37; - } - - bb35: { - StorageDead(_10); -- drop(_9) -> [return: bb36, unwind: bb77]; -+ goto -> bb36; - } - - bb36: { - StorageDead(_9); - goto -> bb37; +- drop(_8) -> [return: bb23, unwind: bb51]; ++ goto -> bb23; } - bb37: { + bb23: { StorageDead(_8); -- drop(_5) -> [return: bb40, unwind: bb80]; -+ goto -> bb40; - } - - bb38: { - StorageDead(_7); -- drop(_6) -> [return: bb39, unwind: bb79]; -+ goto -> bb39; - } - - bb39: { - StorageDead(_6); - goto -> bb40; +- drop(_5) -> [return: bb24, unwind: bb52]; ++ goto -> bb24; } - bb40: { + bb24: { StorageDead(_5); -- drop(_4) -> [return: bb41, unwind: bb81]; -+ goto -> bb41; +- drop(_4) -> [return: bb25, unwind: bb53]; ++ goto -> bb25; } - bb41: { + bb25: { StorageDead(_4); -- drop(_3) -> [return: bb42, unwind: bb82]; -+ goto -> bb42; +- drop(_3) -> [return: bb26, unwind: bb54]; ++ goto -> bb26; } - bb42: { + bb26: { StorageDead(_3); -- drop(_1) -> [return: bb43, unwind continue]; -+ goto -> bb43; +- drop(_1) -> [return: bb27, unwind continue]; ++ goto -> bb27; } - bb43: { + bb27: { coroutine_drop; } - bb44 (cleanup): { + bb28 (cleanup): { StorageDead(_26); -- drop(_25) -> [return: bb45, unwind terminate(cleanup)]; -+ goto -> bb45; +- drop(_25) -> [return: bb29, unwind terminate(cleanup)]; ++ goto -> bb29; } - bb45 (cleanup): { + bb29 (cleanup): { StorageDead(_25); - drop(_24) -> [return: bb46, unwind terminate(cleanup)]; + drop(_24) -> [return: bb30, unwind terminate(cleanup)]; } - bb46 (cleanup): { + bb30 (cleanup): { StorageDead(_24); -- drop(_23) -> [return: bb47, unwind terminate(cleanup)]; -+ goto -> bb47; +- drop(_23) -> [return: bb31, unwind terminate(cleanup)]; ++ goto -> bb31; } - bb47 (cleanup): { + bb31 (cleanup): { StorageDead(_23); - drop(_20) -> [return: bb48, unwind terminate(cleanup)]; + drop(_20) -> [return: bb32, unwind terminate(cleanup)]; } - bb48 (cleanup): { + bb32 (cleanup): { StorageDead(_20); - drop(_19) -> [return: bb49, unwind terminate(cleanup)]; + drop(_19) -> [return: bb33, unwind terminate(cleanup)]; } - bb49 (cleanup): { + bb33 (cleanup): { StorageDead(_19); - goto -> bb52; + goto -> bb36; } - bb50 (cleanup): { -- drop(_18) -> [return: bb51, unwind terminate(cleanup)]; -+ goto -> bb51; + bb34 (cleanup): { +- drop(_18) -> [return: bb35, unwind terminate(cleanup)]; ++ goto -> bb35; } - bb51 (cleanup): { + bb35 (cleanup): { StorageDead(_18); - goto -> bb52; + goto -> bb36; } - bb52 (cleanup): { + bb36 (cleanup): { StorageDead(_17); - drop(_15) -> [return: bb54, unwind terminate(cleanup)]; + drop(_15) -> [return: bb37, unwind terminate(cleanup)]; } - bb53 (cleanup): { - StorageDead(_16); - goto -> bb54; - } - - bb54 (cleanup): { + bb37 (cleanup): { StorageDead(_15); - drop(_11) -> [return: bb58, unwind terminate(cleanup)]; - } - - bb55 (cleanup): { - StorageDead(_14); -- drop(_13) -> [return: bb56, unwind terminate(cleanup)]; -+ goto -> bb56; - } - - bb56 (cleanup): { - StorageDead(_13); -- drop(_12) -> [return: bb57, unwind terminate(cleanup)]; -+ goto -> bb57; + drop(_11) -> [return: bb38, unwind terminate(cleanup)]; } - bb57 (cleanup): { - StorageDead(_12); - goto -> bb58; - } - - bb58 (cleanup): { + bb38 (cleanup): { StorageDead(_11); - drop(_8) -> [return: bb61, unwind terminate(cleanup)]; - } - - bb59 (cleanup): { - StorageDead(_10); -- drop(_9) -> [return: bb60, unwind terminate(cleanup)]; -+ goto -> bb60; - } - - bb60 (cleanup): { - StorageDead(_9); - goto -> bb61; + drop(_8) -> [return: bb39, unwind terminate(cleanup)]; } - bb61 (cleanup): { + bb39 (cleanup): { StorageDead(_8); - drop(_5) -> [return: bb64, unwind terminate(cleanup)]; + drop(_5) -> [return: bb40, unwind terminate(cleanup)]; } - bb62 (cleanup): { - StorageDead(_7); -- drop(_6) -> [return: bb63, unwind terminate(cleanup)]; -+ goto -> bb63; - } - - bb63 (cleanup): { - StorageDead(_6); - goto -> bb64; - } - - bb64 (cleanup): { + bb40 (cleanup): { StorageDead(_5); - drop(_4) -> [return: bb65, unwind terminate(cleanup)]; + drop(_4) -> [return: bb41, unwind terminate(cleanup)]; } - bb65 (cleanup): { + bb41 (cleanup): { StorageDead(_4); - drop(_3) -> [return: bb66, unwind terminate(cleanup)]; + drop(_3) -> [return: bb42, unwind terminate(cleanup)]; } - bb66 (cleanup): { + bb42 (cleanup): { StorageDead(_3); - drop(_1) -> [return: bb67, unwind terminate(cleanup)]; + drop(_1) -> [return: bb43, unwind terminate(cleanup)]; } - bb67 (cleanup): { + bb43 (cleanup): { resume; } - bb68 (cleanup): { + bb44 (cleanup): { StorageDead(_25); -- drop(_24) -> [return: bb69, unwind terminate(cleanup)]; -+ goto -> bb69; +- drop(_24) -> [return: bb45, unwind terminate(cleanup)]; ++ goto -> bb45; } - bb69 (cleanup): { + bb45 (cleanup): { StorageDead(_24); -- drop(_23) -> [return: bb70, unwind terminate(cleanup)]; -+ goto -> bb70; +- drop(_23) -> [return: bb46, unwind terminate(cleanup)]; ++ goto -> bb46; } - bb70 (cleanup): { + bb46 (cleanup): { StorageDead(_23); -- drop(_20) -> [return: bb71, unwind terminate(cleanup)]; -+ goto -> bb71; +- drop(_20) -> [return: bb47, unwind terminate(cleanup)]; ++ goto -> bb47; } - bb71 (cleanup): { + bb47 (cleanup): { StorageDead(_20); -- drop(_19) -> [return: bb72, unwind terminate(cleanup)]; -+ goto -> bb72; +- drop(_19) -> [return: bb48, unwind terminate(cleanup)]; ++ goto -> bb48; } - bb72 (cleanup): { + bb48 (cleanup): { StorageDead(_19); StorageDead(_17); -- drop(_15) -> [return: bb73, unwind terminate(cleanup)]; -+ goto -> bb73; +- drop(_15) -> [return: bb49, unwind terminate(cleanup)]; ++ goto -> bb49; } - bb73 (cleanup): { + bb49 (cleanup): { StorageDead(_15); -- drop(_11) -> [return: bb76, unwind terminate(cleanup)]; -+ goto -> bb76; - } - - bb74 (cleanup): { - StorageDead(_13); -- drop(_12) -> [return: bb75, unwind terminate(cleanup)]; -+ goto -> bb75; - } - - bb75 (cleanup): { - StorageDead(_12); - goto -> bb76; +- drop(_11) -> [return: bb50, unwind terminate(cleanup)]; ++ goto -> bb50; } - bb76 (cleanup): { + bb50 (cleanup): { StorageDead(_11); -- drop(_8) -> [return: bb78, unwind terminate(cleanup)]; -+ goto -> bb78; - } - - bb77 (cleanup): { - StorageDead(_9); - goto -> bb78; +- drop(_8) -> [return: bb51, unwind terminate(cleanup)]; ++ goto -> bb51; } - bb78 (cleanup): { + bb51 (cleanup): { StorageDead(_8); -- drop(_5) -> [return: bb80, unwind terminate(cleanup)]; -+ goto -> bb80; - } - - bb79 (cleanup): { - StorageDead(_6); - goto -> bb80; +- drop(_5) -> [return: bb52, unwind terminate(cleanup)]; ++ goto -> bb52; } - bb80 (cleanup): { + bb52 (cleanup): { StorageDead(_5); -- drop(_4) -> [return: bb81, unwind terminate(cleanup)]; -+ goto -> bb81; +- drop(_4) -> [return: bb53, unwind terminate(cleanup)]; ++ goto -> bb53; } - bb81 (cleanup): { + bb53 (cleanup): { StorageDead(_4); -- drop(_3) -> [return: bb82, unwind terminate(cleanup)]; -+ goto -> bb82; +- drop(_3) -> [return: bb54, unwind terminate(cleanup)]; ++ goto -> bb54; } - bb82 (cleanup): { + bb54 (cleanup): { StorageDead(_3); -- drop(_1) -> [return: bb67, unwind terminate(cleanup)]; -+ goto -> bb67; +- drop(_1) -> [return: bb43, unwind terminate(cleanup)]; ++ goto -> bb43; + } + -+ bb83: { ++ bb55: { + StorageDead(_27); -+ goto -> bb10; ++ goto -> bb2; + } + -+ bb84: { ++ bb56: { + StorageDead(_27); -+ goto -> bb23; ++ goto -> bb15; + } + -+ bb85 (cleanup): { ++ bb57 (cleanup): { + StorageDead(_27); -+ goto -> bb44; ++ goto -> bb28; + } + -+ bb86: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb86, unwind: bb85]; ++ bb58: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb58, unwind: bb57]; + } + -+ bb87: { ++ bb59: { + _2 = move _28; + StorageDead(_28); -+ goto -> bb86; ++ goto -> bb58; + } + -+ bb88: { ++ bb60: { + _2 = move _28; + StorageDead(_28); -+ goto -> bb94; ++ goto -> bb66; + } + -+ bb89: { ++ bb61: { + StorageLive(_28); -+ _28 = yield(const ()) -> [resume: bb87, drop: bb88]; ++ _28 = yield(const ()) -> [resume: bb59, drop: bb60]; + } + -+ bb90: { ++ bb62: { + unreachable; + } + -+ bb91: { ++ bb63: { + _30 = discriminant(_29); -+ switchInt(move _30) -> [0: bb84, 1: bb89, otherwise: bb90]; ++ switchInt(move _30) -> [0: bb56, 1: bb61, otherwise: bb62]; + } + -+ bb92: { -+ _29 = as Future>::poll(move _31, move _32) -> [return: bb91, unwind: bb85]; ++ bb64: { ++ _29 = as Future>::poll(move _31, move _32) -> [return: bb63, unwind: bb57]; + } + -+ bb93: { ++ bb65: { + _33 = move _2; -+ _32 = std::future::get_context::<'_, '_>(move _33) -> [return: bb92, unwind: bb85]; ++ _32 = std::future::get_context::<'_, '_>(move _33) -> [return: bb64, unwind: bb57]; + } + -+ bb94: { ++ bb66: { + _34 = &mut _27; -+ _31 = Pin::<&mut impl Future>::new_unchecked(move _34) -> [return: bb93, unwind: bb85]; ++ _31 = Pin::<&mut impl Future>::new_unchecked(move _34) -> [return: bb65, unwind: bb57]; + } + -+ bb95: { ++ bb67: { + _2 = move _35; + StorageDead(_35); -+ goto -> bb101; ++ goto -> bb73; + } + -+ bb96: { ++ bb68: { + _2 = move _35; + StorageDead(_35); -+ goto -> bb94; ++ goto -> bb66; + } + -+ bb97: { ++ bb69: { + StorageLive(_35); -+ _35 = yield(const ()) -> [resume: bb95, drop: bb96]; ++ _35 = yield(const ()) -> [resume: bb67, drop: bb68]; + } + -+ bb98: { ++ bb70: { + _37 = discriminant(_36); -+ switchInt(move _37) -> [0: bb83, 1: bb97, otherwise: bb90]; ++ switchInt(move _37) -> [0: bb55, 1: bb69, otherwise: bb62]; + } + -+ bb99: { -+ _36 = as Future>::poll(move _38, move _39) -> [return: bb98, unwind: bb85]; ++ bb71: { ++ _36 = as Future>::poll(move _38, move _39) -> [return: bb70, unwind: bb57]; + } + -+ bb100: { ++ bb72: { + _40 = move _2; -+ _39 = std::future::get_context::<'_, '_>(move _40) -> [return: bb99, unwind: bb85]; ++ _39 = std::future::get_context::<'_, '_>(move _40) -> [return: bb71, unwind: bb57]; + } + -+ bb101: { ++ bb73: { + _41 = &mut _27; -+ _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb100, unwind: bb85]; ++ _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb72, unwind: bb57]; + } + -+ bb102: { ++ bb74: { + StorageLive(_27); -+ _27 = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb101, unwind: bb85]; ++ _27 = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb73, unwind: bb57]; + } + -+ bb103: { ++ bb75: { + _43 = &mut _26; -+ _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb102, unwind: bb44]; ++ _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb74, unwind: bb28]; + } + -+ bb104: { ++ bb76: { + StorageDead(_44); -+ goto -> bb12; ++ goto -> bb4; + } + -+ bb105: { ++ bb77: { + StorageDead(_44); -+ goto -> bb25; ++ goto -> bb17; + } + -+ bb106 (cleanup): { ++ bb78 (cleanup): { + StorageDead(_44); -+ goto -> bb46; ++ goto -> bb30; + } + -+ bb107: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb107, unwind: bb106]; ++ bb79: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb79, unwind: bb78]; + } + -+ bb108: { ++ bb80: { + _2 = move _45; + StorageDead(_45); -+ goto -> bb107; ++ goto -> bb79; + } + -+ bb109: { ++ bb81: { + _2 = move _45; + StorageDead(_45); -+ goto -> bb114; ++ goto -> bb86; + } + -+ bb110: { ++ bb82: { + StorageLive(_45); -+ _45 = yield(const ()) -> [resume: bb108, drop: bb109]; ++ _45 = yield(const ()) -> [resume: bb80, drop: bb81]; + } + -+ bb111: { ++ bb83: { + _47 = discriminant(_46); -+ switchInt(move _47) -> [0: bb105, 1: bb110, otherwise: bb90]; ++ switchInt(move _47) -> [0: bb77, 1: bb82, otherwise: bb62]; + } + -+ bb112: { -+ _46 = as Future>::poll(move _48, move _49) -> [return: bb111, unwind: bb106]; ++ bb84: { ++ _46 = as Future>::poll(move _48, move _49) -> [return: bb83, unwind: bb78]; + } + -+ bb113: { ++ bb85: { + _50 = move _2; -+ _49 = std::future::get_context::<'_, '_>(move _50) -> [return: bb112, unwind: bb106]; ++ _49 = std::future::get_context::<'_, '_>(move _50) -> [return: bb84, unwind: bb78]; + } + -+ bb114: { ++ bb86: { + _51 = &mut _44; -+ _48 = Pin::<&mut impl Future>::new_unchecked(move _51) -> [return: bb113, unwind: bb106]; ++ _48 = Pin::<&mut impl Future>::new_unchecked(move _51) -> [return: bb85, unwind: bb78]; + } + -+ bb115: { ++ bb87: { + _2 = move _52; + StorageDead(_52); -+ goto -> bb121; ++ goto -> bb93; + } + -+ bb116: { ++ bb88: { + _2 = move _52; + StorageDead(_52); -+ goto -> bb114; ++ goto -> bb86; + } + -+ bb117: { ++ bb89: { + StorageLive(_52); -+ _52 = yield(const ()) -> [resume: bb115, drop: bb116]; ++ _52 = yield(const ()) -> [resume: bb87, drop: bb88]; + } + -+ bb118: { ++ bb90: { + _54 = discriminant(_53); -+ switchInt(move _54) -> [0: bb104, 1: bb117, otherwise: bb90]; ++ switchInt(move _54) -> [0: bb76, 1: bb89, otherwise: bb62]; + } + -+ bb119: { -+ _53 = as Future>::poll(move _55, move _56) -> [return: bb118, unwind: bb106]; ++ bb91: { ++ _53 = as Future>::poll(move _55, move _56) -> [return: bb90, unwind: bb78]; + } + -+ bb120: { ++ bb92: { + _57 = move _2; -+ _56 = std::future::get_context::<'_, '_>(move _57) -> [return: bb119, unwind: bb106]; ++ _56 = std::future::get_context::<'_, '_>(move _57) -> [return: bb91, unwind: bb78]; + } + -+ bb121: { ++ bb93: { + _58 = &mut _44; -+ _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb120, unwind: bb106]; ++ _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb92, unwind: bb78]; + } + -+ bb122: { ++ bb94: { + StorageLive(_44); -+ _44 = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb121, unwind: bb106]; ++ _44 = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb93, unwind: bb78]; + } + -+ bb123: { ++ bb95: { + _60 = &mut _24; -+ _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb122, unwind: bb46]; ++ _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb94, unwind: bb30]; + } + -+ bb124: { ++ bb96: { + StorageDead(_61); -+ goto -> bb14; ++ goto -> bb6; + } + -+ bb125: { ++ bb97: { + StorageDead(_61); -+ goto -> bb27; ++ goto -> bb19; + } + -+ bb126 (cleanup): { ++ bb98 (cleanup): { + StorageDead(_61); -+ goto -> bb48; ++ goto -> bb32; + } + -+ bb127: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb127, unwind: bb126]; ++ bb99: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb99, unwind: bb98]; + } + -+ bb128: { ++ bb100: { + _2 = move _62; + StorageDead(_62); -+ goto -> bb127; ++ goto -> bb99; + } + -+ bb129: { ++ bb101: { + _2 = move _62; + StorageDead(_62); -+ goto -> bb134; ++ goto -> bb106; + } + -+ bb130: { ++ bb102: { + StorageLive(_62); -+ _62 = yield(const ()) -> [resume: bb128, drop: bb129]; ++ _62 = yield(const ()) -> [resume: bb100, drop: bb101]; + } + -+ bb131: { ++ bb103: { + _64 = discriminant(_63); -+ switchInt(move _64) -> [0: bb125, 1: bb130, otherwise: bb90]; ++ switchInt(move _64) -> [0: bb97, 1: bb102, otherwise: bb62]; + } + -+ bb132: { -+ _63 = as Future>::poll(move _65, move _66) -> [return: bb131, unwind: bb126]; ++ bb104: { ++ _63 = as Future>::poll(move _65, move _66) -> [return: bb103, unwind: bb98]; + } + -+ bb133: { ++ bb105: { + _67 = move _2; -+ _66 = std::future::get_context::<'_, '_>(move _67) -> [return: bb132, unwind: bb126]; ++ _66 = std::future::get_context::<'_, '_>(move _67) -> [return: bb104, unwind: bb98]; + } + -+ bb134: { ++ bb106: { + _68 = &mut _61; -+ _65 = Pin::<&mut impl Future>::new_unchecked(move _68) -> [return: bb133, unwind: bb126]; ++ _65 = Pin::<&mut impl Future>::new_unchecked(move _68) -> [return: bb105, unwind: bb98]; + } + -+ bb135: { ++ bb107: { + _2 = move _69; + StorageDead(_69); -+ goto -> bb141; ++ goto -> bb113; + } + -+ bb136: { ++ bb108: { + _2 = move _69; + StorageDead(_69); -+ goto -> bb134; ++ goto -> bb106; + } + -+ bb137: { ++ bb109: { + StorageLive(_69); -+ _69 = yield(const ()) -> [resume: bb135, drop: bb136]; ++ _69 = yield(const ()) -> [resume: bb107, drop: bb108]; + } + -+ bb138: { ++ bb110: { + _71 = discriminant(_70); -+ switchInt(move _71) -> [0: bb124, 1: bb137, otherwise: bb90]; ++ switchInt(move _71) -> [0: bb96, 1: bb109, otherwise: bb62]; + } + -+ bb139: { -+ _70 = as Future>::poll(move _72, move _73) -> [return: bb138, unwind: bb126]; ++ bb111: { ++ _70 = as Future>::poll(move _72, move _73) -> [return: bb110, unwind: bb98]; + } + -+ bb140: { ++ bb112: { + _74 = move _2; -+ _73 = std::future::get_context::<'_, '_>(move _74) -> [return: bb139, unwind: bb126]; ++ _73 = std::future::get_context::<'_, '_>(move _74) -> [return: bb111, unwind: bb98]; + } + -+ bb141: { ++ bb113: { + _75 = &mut _61; -+ _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb140, unwind: bb126]; ++ _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb112, unwind: bb98]; + } + -+ bb142: { ++ bb114: { + StorageLive(_61); -+ _61 = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb141, unwind: bb126]; ++ _61 = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb113, unwind: bb98]; + } + -+ bb143: { ++ bb115: { + _77 = &mut _20; -+ _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb142, unwind: bb48]; ++ _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb114, unwind: bb32]; + } + -+ bb144: { ++ bb116: { + StorageDead(_78); -+ goto -> bb15; ++ goto -> bb7; + } + -+ bb145: { ++ bb117: { + StorageDead(_78); -+ goto -> bb28; ++ goto -> bb20; + } + -+ bb146 (cleanup): { ++ bb118 (cleanup): { + StorageDead(_78); -+ goto -> bb49; ++ goto -> bb33; + } + -+ bb147: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb147, unwind: bb146]; ++ bb119: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb119, unwind: bb118]; + } + -+ bb148: { ++ bb120: { + _2 = move _79; + StorageDead(_79); -+ goto -> bb147; ++ goto -> bb119; + } + -+ bb149: { ++ bb121: { + _2 = move _79; + StorageDead(_79); -+ goto -> bb154; ++ goto -> bb126; + } + -+ bb150: { ++ bb122: { + StorageLive(_79); -+ _79 = yield(const ()) -> [resume: bb148, drop: bb149]; ++ _79 = yield(const ()) -> [resume: bb120, drop: bb121]; + } + -+ bb151: { ++ bb123: { + _81 = discriminant(_80); -+ switchInt(move _81) -> [0: bb145, 1: bb150, otherwise: bb90]; ++ switchInt(move _81) -> [0: bb117, 1: bb122, otherwise: bb62]; + } + -+ bb152: { -+ _80 = as Future>::poll(move _82, move _83) -> [return: bb151, unwind: bb146]; ++ bb124: { ++ _80 = as Future>::poll(move _82, move _83) -> [return: bb123, unwind: bb118]; + } + -+ bb153: { ++ bb125: { + _84 = move _2; -+ _83 = std::future::get_context::<'_, '_>(move _84) -> [return: bb152, unwind: bb146]; ++ _83 = std::future::get_context::<'_, '_>(move _84) -> [return: bb124, unwind: bb118]; + } + -+ bb154: { ++ bb126: { + _85 = &mut _78; -+ _82 = Pin::<&mut impl Future>::new_unchecked(move _85) -> [return: bb153, unwind: bb146]; ++ _82 = Pin::<&mut impl Future>::new_unchecked(move _85) -> [return: bb125, unwind: bb118]; + } + -+ bb155: { ++ bb127: { + _2 = move _86; + StorageDead(_86); -+ goto -> bb161; ++ goto -> bb133; + } + -+ bb156: { ++ bb128: { + _2 = move _86; + StorageDead(_86); -+ goto -> bb154; ++ goto -> bb126; + } + -+ bb157: { ++ bb129: { + StorageLive(_86); -+ _86 = yield(const ()) -> [resume: bb155, drop: bb156]; ++ _86 = yield(const ()) -> [resume: bb127, drop: bb128]; + } + -+ bb158: { ++ bb130: { + _88 = discriminant(_87); -+ switchInt(move _88) -> [0: bb144, 1: bb157, otherwise: bb90]; ++ switchInt(move _88) -> [0: bb116, 1: bb129, otherwise: bb62]; + } + -+ bb159: { -+ _87 = as Future>::poll(move _89, move _90) -> [return: bb158, unwind: bb146]; ++ bb131: { ++ _87 = as Future>::poll(move _89, move _90) -> [return: bb130, unwind: bb118]; + } + -+ bb160: { ++ bb132: { + _91 = move _2; -+ _90 = std::future::get_context::<'_, '_>(move _91) -> [return: bb159, unwind: bb146]; ++ _90 = std::future::get_context::<'_, '_>(move _91) -> [return: bb131, unwind: bb118]; + } + -+ bb161: { ++ bb133: { + _92 = &mut _78; -+ _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb160, unwind: bb146]; ++ _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb132, unwind: bb118]; + } + -+ bb162: { ++ bb134: { + StorageLive(_78); -+ _78 = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb161, unwind: bb146]; ++ _78 = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb133, unwind: bb118]; + } + -+ bb163: { ++ bb135: { + _94 = &mut _19; -+ _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb162, unwind: bb49]; ++ _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb134, unwind: bb33]; + } + -+ bb164: { ++ bb136: { + StorageDead(_95); -+ goto -> bb16; ++ goto -> bb8; + } + -+ bb165: { ++ bb137: { + StorageDead(_95); -+ goto -> bb30; ++ goto -> bb21; + } + -+ bb166 (cleanup): { ++ bb138 (cleanup): { + StorageDead(_95); -+ goto -> bb54; ++ goto -> bb37; + } + -+ bb167: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb167, unwind: bb166]; ++ bb139: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb139, unwind: bb138]; + } + -+ bb168: { ++ bb140: { + _2 = move _96; + StorageDead(_96); -+ goto -> bb167; ++ goto -> bb139; + } + -+ bb169: { ++ bb141: { + _2 = move _96; + StorageDead(_96); -+ goto -> bb174; ++ goto -> bb146; + } + -+ bb170: { ++ bb142: { + StorageLive(_96); -+ _96 = yield(const ()) -> [resume: bb168, drop: bb169]; ++ _96 = yield(const ()) -> [resume: bb140, drop: bb141]; + } + -+ bb171: { ++ bb143: { + _98 = discriminant(_97); -+ switchInt(move _98) -> [0: bb165, 1: bb170, otherwise: bb90]; ++ switchInt(move _98) -> [0: bb137, 1: bb142, otherwise: bb62]; + } + -+ bb172: { -+ _97 = as Future>::poll(move _99, move _100) -> [return: bb171, unwind: bb166]; ++ bb144: { ++ _97 = as Future>::poll(move _99, move _100) -> [return: bb143, unwind: bb138]; + } + -+ bb173: { ++ bb145: { + _101 = move _2; -+ _100 = std::future::get_context::<'_, '_>(move _101) -> [return: bb172, unwind: bb166]; ++ _100 = std::future::get_context::<'_, '_>(move _101) -> [return: bb144, unwind: bb138]; + } + -+ bb174: { ++ bb146: { + _102 = &mut _95; -+ _99 = Pin::<&mut impl Future>::new_unchecked(move _102) -> [return: bb173, unwind: bb166]; ++ _99 = Pin::<&mut impl Future>::new_unchecked(move _102) -> [return: bb145, unwind: bb138]; + } + -+ bb175: { ++ bb147: { + _2 = move _103; + StorageDead(_103); -+ goto -> bb181; ++ goto -> bb153; + } + -+ bb176: { ++ bb148: { + _2 = move _103; + StorageDead(_103); -+ goto -> bb174; ++ goto -> bb146; + } + -+ bb177: { ++ bb149: { + StorageLive(_103); -+ _103 = yield(const ()) -> [resume: bb175, drop: bb176]; ++ _103 = yield(const ()) -> [resume: bb147, drop: bb148]; + } + -+ bb178: { ++ bb150: { + _105 = discriminant(_104); -+ switchInt(move _105) -> [0: bb164, 1: bb177, otherwise: bb90]; ++ switchInt(move _105) -> [0: bb136, 1: bb149, otherwise: bb62]; + } + -+ bb179: { -+ _104 = as Future>::poll(move _106, move _107) -> [return: bb178, unwind: bb166]; ++ bb151: { ++ _104 = as Future>::poll(move _106, move _107) -> [return: bb150, unwind: bb138]; + } + -+ bb180: { ++ bb152: { + _108 = move _2; -+ _107 = std::future::get_context::<'_, '_>(move _108) -> [return: bb179, unwind: bb166]; ++ _107 = std::future::get_context::<'_, '_>(move _108) -> [return: bb151, unwind: bb138]; + } + -+ bb181: { ++ bb153: { + _109 = &mut _95; -+ _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb180, unwind: bb166]; ++ _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb152, unwind: bb138]; + } + -+ bb182: { ++ bb154: { + StorageLive(_95); -+ _95 = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb181, unwind: bb166]; ++ _95 = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb153, unwind: bb138]; + } + -+ bb183: { ++ bb155: { + _111 = &mut _15; -+ _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb182, unwind: bb54]; ++ _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb154, unwind: bb37]; + } + -+ bb184: { ++ bb156: { + StorageDead(_112); -+ goto -> bb17; ++ goto -> bb9; + } + -+ bb185: { ++ bb157: { + StorageDead(_112); -+ goto -> bb34; ++ goto -> bb22; + } + -+ bb186 (cleanup): { ++ bb158 (cleanup): { + StorageDead(_112); -+ goto -> bb58; ++ goto -> bb38; + } + -+ bb187: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb187, unwind: bb186]; ++ bb159: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb159, unwind: bb158]; + } + -+ bb188: { ++ bb160: { + _2 = move _113; + StorageDead(_113); -+ goto -> bb187; ++ goto -> bb159; + } + -+ bb189: { ++ bb161: { + _2 = move _113; + StorageDead(_113); -+ goto -> bb194; ++ goto -> bb166; + } + -+ bb190: { ++ bb162: { + StorageLive(_113); -+ _113 = yield(const ()) -> [resume: bb188, drop: bb189]; ++ _113 = yield(const ()) -> [resume: bb160, drop: bb161]; + } + -+ bb191: { ++ bb163: { + _115 = discriminant(_114); -+ switchInt(move _115) -> [0: bb185, 1: bb190, otherwise: bb90]; ++ switchInt(move _115) -> [0: bb157, 1: bb162, otherwise: bb62]; + } + -+ bb192: { -+ _114 = as Future>::poll(move _116, move _117) -> [return: bb191, unwind: bb186]; ++ bb164: { ++ _114 = as Future>::poll(move _116, move _117) -> [return: bb163, unwind: bb158]; + } + -+ bb193: { ++ bb165: { + _118 = move _2; -+ _117 = std::future::get_context::<'_, '_>(move _118) -> [return: bb192, unwind: bb186]; ++ _117 = std::future::get_context::<'_, '_>(move _118) -> [return: bb164, unwind: bb158]; + } + -+ bb194: { ++ bb166: { + _119 = &mut _112; -+ _116 = Pin::<&mut impl Future>::new_unchecked(move _119) -> [return: bb193, unwind: bb186]; ++ _116 = Pin::<&mut impl Future>::new_unchecked(move _119) -> [return: bb165, unwind: bb158]; + } + -+ bb195: { ++ bb167: { + _2 = move _120; + StorageDead(_120); -+ goto -> bb201; ++ goto -> bb173; + } + -+ bb196: { ++ bb168: { + _2 = move _120; + StorageDead(_120); -+ goto -> bb194; ++ goto -> bb166; + } + -+ bb197: { ++ bb169: { + StorageLive(_120); -+ _120 = yield(const ()) -> [resume: bb195, drop: bb196]; ++ _120 = yield(const ()) -> [resume: bb167, drop: bb168]; + } + -+ bb198: { ++ bb170: { + _122 = discriminant(_121); -+ switchInt(move _122) -> [0: bb184, 1: bb197, otherwise: bb90]; ++ switchInt(move _122) -> [0: bb156, 1: bb169, otherwise: bb62]; + } + -+ bb199: { -+ _121 = as Future>::poll(move _123, move _124) -> [return: bb198, unwind: bb186]; ++ bb171: { ++ _121 = as Future>::poll(move _123, move _124) -> [return: bb170, unwind: bb158]; + } + -+ bb200: { ++ bb172: { + _125 = move _2; -+ _124 = std::future::get_context::<'_, '_>(move _125) -> [return: bb199, unwind: bb186]; ++ _124 = std::future::get_context::<'_, '_>(move _125) -> [return: bb171, unwind: bb158]; + } + -+ bb201: { ++ bb173: { + _126 = &mut _112; -+ _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb200, unwind: bb186]; ++ _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb172, unwind: bb158]; + } + -+ bb202: { ++ bb174: { + StorageLive(_112); -+ _112 = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb201, unwind: bb186]; ++ _112 = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb173, unwind: bb158]; + } + -+ bb203: { ++ bb175: { + _128 = &mut _11; -+ _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb202, unwind: bb58]; ++ _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb174, unwind: bb38]; + } + -+ bb204: { ++ bb176: { + StorageDead(_129); -+ goto -> bb18; ++ goto -> bb10; + } + -+ bb205: { ++ bb177: { + StorageDead(_129); -+ goto -> bb37; ++ goto -> bb23; + } + -+ bb206 (cleanup): { ++ bb178 (cleanup): { + StorageDead(_129); -+ goto -> bb61; ++ goto -> bb39; + } + -+ bb207: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb207, unwind: bb206]; ++ bb179: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb179, unwind: bb178]; + } + -+ bb208: { ++ bb180: { + _2 = move _130; + StorageDead(_130); -+ goto -> bb207; ++ goto -> bb179; + } + -+ bb209: { ++ bb181: { + _2 = move _130; + StorageDead(_130); -+ goto -> bb214; ++ goto -> bb186; + } + -+ bb210: { ++ bb182: { + StorageLive(_130); -+ _130 = yield(const ()) -> [resume: bb208, drop: bb209]; ++ _130 = yield(const ()) -> [resume: bb180, drop: bb181]; + } + -+ bb211: { ++ bb183: { + _132 = discriminant(_131); -+ switchInt(move _132) -> [0: bb205, 1: bb210, otherwise: bb90]; ++ switchInt(move _132) -> [0: bb177, 1: bb182, otherwise: bb62]; + } + -+ bb212: { -+ _131 = as Future>::poll(move _133, move _134) -> [return: bb211, unwind: bb206]; ++ bb184: { ++ _131 = as Future>::poll(move _133, move _134) -> [return: bb183, unwind: bb178]; + } + -+ bb213: { ++ bb185: { + _135 = move _2; -+ _134 = std::future::get_context::<'_, '_>(move _135) -> [return: bb212, unwind: bb206]; ++ _134 = std::future::get_context::<'_, '_>(move _135) -> [return: bb184, unwind: bb178]; + } + -+ bb214: { ++ bb186: { + _136 = &mut _129; -+ _133 = Pin::<&mut impl Future>::new_unchecked(move _136) -> [return: bb213, unwind: bb206]; ++ _133 = Pin::<&mut impl Future>::new_unchecked(move _136) -> [return: bb185, unwind: bb178]; + } + -+ bb215: { ++ bb187: { + _2 = move _137; + StorageDead(_137); -+ goto -> bb221; ++ goto -> bb193; + } + -+ bb216: { ++ bb188: { + _2 = move _137; + StorageDead(_137); -+ goto -> bb214; ++ goto -> bb186; + } + -+ bb217: { ++ bb189: { + StorageLive(_137); -+ _137 = yield(const ()) -> [resume: bb215, drop: bb216]; ++ _137 = yield(const ()) -> [resume: bb187, drop: bb188]; + } + -+ bb218: { ++ bb190: { + _139 = discriminant(_138); -+ switchInt(move _139) -> [0: bb204, 1: bb217, otherwise: bb90]; ++ switchInt(move _139) -> [0: bb176, 1: bb189, otherwise: bb62]; + } + -+ bb219: { -+ _138 = as Future>::poll(move _140, move _141) -> [return: bb218, unwind: bb206]; ++ bb191: { ++ _138 = as Future>::poll(move _140, move _141) -> [return: bb190, unwind: bb178]; + } + -+ bb220: { ++ bb192: { + _142 = move _2; -+ _141 = std::future::get_context::<'_, '_>(move _142) -> [return: bb219, unwind: bb206]; ++ _141 = std::future::get_context::<'_, '_>(move _142) -> [return: bb191, unwind: bb178]; + } + -+ bb221: { ++ bb193: { + _143 = &mut _129; -+ _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb220, unwind: bb206]; ++ _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb192, unwind: bb178]; + } + -+ bb222: { ++ bb194: { + StorageLive(_129); -+ _129 = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb221, unwind: bb206]; ++ _129 = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb193, unwind: bb178]; + } + -+ bb223: { ++ bb195: { + _145 = &mut _8; -+ _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb222, unwind: bb61]; ++ _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb194, unwind: bb39]; + } + -+ bb224: { ++ bb196: { + StorageDead(_146); -+ goto -> bb19; ++ goto -> bb11; + } + -+ bb225: { ++ bb197: { + StorageDead(_146); -+ goto -> bb40; ++ goto -> bb24; + } + -+ bb226 (cleanup): { ++ bb198 (cleanup): { + StorageDead(_146); -+ goto -> bb64; ++ goto -> bb40; + } + -+ bb227: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb227, unwind: bb226]; ++ bb199: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb199, unwind: bb198]; + } + -+ bb228: { ++ bb200: { + _2 = move _147; + StorageDead(_147); -+ goto -> bb227; ++ goto -> bb199; + } + -+ bb229: { ++ bb201: { + _2 = move _147; + StorageDead(_147); -+ goto -> bb234; ++ goto -> bb206; + } + -+ bb230: { ++ bb202: { + StorageLive(_147); -+ _147 = yield(const ()) -> [resume: bb228, drop: bb229]; ++ _147 = yield(const ()) -> [resume: bb200, drop: bb201]; + } + -+ bb231: { ++ bb203: { + _149 = discriminant(_148); -+ switchInt(move _149) -> [0: bb225, 1: bb230, otherwise: bb90]; ++ switchInt(move _149) -> [0: bb197, 1: bb202, otherwise: bb62]; + } + -+ bb232: { -+ _148 = as Future>::poll(move _150, move _151) -> [return: bb231, unwind: bb226]; ++ bb204: { ++ _148 = as Future>::poll(move _150, move _151) -> [return: bb203, unwind: bb198]; + } + -+ bb233: { ++ bb205: { + _152 = move _2; -+ _151 = std::future::get_context::<'_, '_>(move _152) -> [return: bb232, unwind: bb226]; ++ _151 = std::future::get_context::<'_, '_>(move _152) -> [return: bb204, unwind: bb198]; + } + -+ bb234: { ++ bb206: { + _153 = &mut _146; -+ _150 = Pin::<&mut impl Future>::new_unchecked(move _153) -> [return: bb233, unwind: bb226]; ++ _150 = Pin::<&mut impl Future>::new_unchecked(move _153) -> [return: bb205, unwind: bb198]; + } + -+ bb235: { ++ bb207: { + _2 = move _154; + StorageDead(_154); -+ goto -> bb241; ++ goto -> bb213; + } + -+ bb236: { ++ bb208: { + _2 = move _154; + StorageDead(_154); -+ goto -> bb234; ++ goto -> bb206; + } + -+ bb237: { ++ bb209: { + StorageLive(_154); -+ _154 = yield(const ()) -> [resume: bb235, drop: bb236]; ++ _154 = yield(const ()) -> [resume: bb207, drop: bb208]; + } + -+ bb238: { ++ bb210: { + _156 = discriminant(_155); -+ switchInt(move _156) -> [0: bb224, 1: bb237, otherwise: bb90]; ++ switchInt(move _156) -> [0: bb196, 1: bb209, otherwise: bb62]; + } + -+ bb239: { -+ _155 = as Future>::poll(move _157, move _158) -> [return: bb238, unwind: bb226]; ++ bb211: { ++ _155 = as Future>::poll(move _157, move _158) -> [return: bb210, unwind: bb198]; + } + -+ bb240: { ++ bb212: { + _159 = move _2; -+ _158 = std::future::get_context::<'_, '_>(move _159) -> [return: bb239, unwind: bb226]; ++ _158 = std::future::get_context::<'_, '_>(move _159) -> [return: bb211, unwind: bb198]; + } + -+ bb241: { ++ bb213: { + _160 = &mut _146; -+ _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb240, unwind: bb226]; ++ _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb212, unwind: bb198]; + } + -+ bb242: { ++ bb214: { + StorageLive(_146); -+ _146 = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb241, unwind: bb226]; ++ _146 = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb213, unwind: bb198]; + } + -+ bb243: { ++ bb215: { + _162 = &mut _5; -+ _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb242, unwind: bb64]; ++ _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb214, unwind: bb40]; + } + -+ bb244: { ++ bb216: { + StorageDead(_163); -+ goto -> bb20; ++ goto -> bb12; + } + -+ bb245: { ++ bb217: { + StorageDead(_163); -+ goto -> bb41; ++ goto -> bb25; + } + -+ bb246 (cleanup): { ++ bb218 (cleanup): { + StorageDead(_163); -+ goto -> bb65; ++ goto -> bb41; + } + -+ bb247: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb247, unwind: bb246]; ++ bb219: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb219, unwind: bb218]; + } + -+ bb248: { ++ bb220: { + _2 = move _164; + StorageDead(_164); -+ goto -> bb247; ++ goto -> bb219; + } + -+ bb249: { ++ bb221: { + _2 = move _164; + StorageDead(_164); -+ goto -> bb254; ++ goto -> bb226; + } + -+ bb250: { ++ bb222: { + StorageLive(_164); -+ _164 = yield(const ()) -> [resume: bb248, drop: bb249]; ++ _164 = yield(const ()) -> [resume: bb220, drop: bb221]; + } + -+ bb251: { ++ bb223: { + _166 = discriminant(_165); -+ switchInt(move _166) -> [0: bb245, 1: bb250, otherwise: bb90]; ++ switchInt(move _166) -> [0: bb217, 1: bb222, otherwise: bb62]; + } + -+ bb252: { -+ _165 = as Future>::poll(move _167, move _168) -> [return: bb251, unwind: bb246]; ++ bb224: { ++ _165 = as Future>::poll(move _167, move _168) -> [return: bb223, unwind: bb218]; + } + -+ bb253: { ++ bb225: { + _169 = move _2; -+ _168 = std::future::get_context::<'_, '_>(move _169) -> [return: bb252, unwind: bb246]; ++ _168 = std::future::get_context::<'_, '_>(move _169) -> [return: bb224, unwind: bb218]; + } + -+ bb254: { ++ bb226: { + _170 = &mut _163; -+ _167 = Pin::<&mut impl Future>::new_unchecked(move _170) -> [return: bb253, unwind: bb246]; ++ _167 = Pin::<&mut impl Future>::new_unchecked(move _170) -> [return: bb225, unwind: bb218]; + } + -+ bb255: { ++ bb227: { + _2 = move _171; + StorageDead(_171); -+ goto -> bb261; ++ goto -> bb233; + } + -+ bb256: { ++ bb228: { + _2 = move _171; + StorageDead(_171); -+ goto -> bb254; ++ goto -> bb226; + } + -+ bb257: { ++ bb229: { + StorageLive(_171); -+ _171 = yield(const ()) -> [resume: bb255, drop: bb256]; ++ _171 = yield(const ()) -> [resume: bb227, drop: bb228]; + } + -+ bb258: { ++ bb230: { + _173 = discriminant(_172); -+ switchInt(move _173) -> [0: bb244, 1: bb257, otherwise: bb90]; ++ switchInt(move _173) -> [0: bb216, 1: bb229, otherwise: bb62]; + } + -+ bb259: { -+ _172 = as Future>::poll(move _174, move _175) -> [return: bb258, unwind: bb246]; ++ bb231: { ++ _172 = as Future>::poll(move _174, move _175) -> [return: bb230, unwind: bb218]; + } + -+ bb260: { ++ bb232: { + _176 = move _2; -+ _175 = std::future::get_context::<'_, '_>(move _176) -> [return: bb259, unwind: bb246]; ++ _175 = std::future::get_context::<'_, '_>(move _176) -> [return: bb231, unwind: bb218]; + } + -+ bb261: { ++ bb233: { + _177 = &mut _163; -+ _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb260, unwind: bb246]; ++ _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb232, unwind: bb218]; + } + -+ bb262: { ++ bb234: { + StorageLive(_163); -+ _163 = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb261, unwind: bb246]; ++ _163 = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb233, unwind: bb218]; + } + -+ bb263: { ++ bb235: { + _179 = &mut _4; -+ _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb262, unwind: bb65]; ++ _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb234, unwind: bb41]; } } diff --git a/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.StateTransform.diff b/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.StateTransform.diff index 5fb3dba08ad87..f4bf44a135189 100644 --- a/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.StateTransform.diff +++ b/tests/mir-opt/coroutine/async_drop.elaborate_drops-{closure#0}.StateTransform.diff @@ -308,83 +308,44 @@ - StorageLive(_7); - _7 = AsyncInt(const 2_i32); - _5 = [move _6, move _7]; -- goto -> bb1; -+ _184 = move _2 as std::ptr::NonNull> (Transmute); -+ _183 = std::future::ResumeTy(move _184); -+ _182 = copy (_1.0: &mut {async fn body of elaborate_drops()}); -+ _181 = discriminant((*_182)); -+ switchInt(move _181) -> [0: bb170, 1: bb169, 2: bb168, 3: bb150, 4: bb151, 5: bb152, 6: bb153, 7: bb154, 8: bb155, 9: bb156, 10: bb157, 11: bb158, 12: bb159, 13: bb160, 14: bb161, 15: bb162, 16: bb163, 17: bb164, 18: bb165, 19: bb166, 20: bb167, otherwise: bb43]; - } - - bb1: { - StorageDead(_7); - goto -> bb2; - } - - bb2: { - StorageDead(_6); +- StorageDead(_7); +- StorageDead(_6); - StorageLive(_8); -+ nop; - StorageLive(_9); - _9 = AsyncInt(const 5_i32); - StorageLive(_10); - _10 = AsyncInt(const 4_i32); +- StorageLive(_9); +- _9 = AsyncInt(const 5_i32); +- StorageLive(_10); +- _10 = AsyncInt(const 4_i32); - _8 = AsyncStruct { i: const 3_i32, a: move _10, b: move _9 }; -+ (((*_182) as variant#16).4: AsyncStruct) = AsyncStruct { i: const 3_i32, a: move _10, b: move _9 }; - goto -> bb3; - } - - bb3: { - StorageDead(_10); - goto -> bb4; - } - - bb4: { - StorageDead(_9); +- StorageDead(_10); +- StorageDead(_9); - StorageLive(_11); -+ nop; - StorageLive(_12); - _12 = AsyncInt(const 7_i32); - StorageLive(_13); - _13 = SyncInt(const 8_i32); - StorageLive(_14); - _14 = AsyncInt(const 9_i32); +- StorageLive(_12); +- _12 = AsyncInt(const 7_i32); +- StorageLive(_13); +- _13 = SyncInt(const 8_i32); +- StorageLive(_14); +- _14 = AsyncInt(const 9_i32); - _11 = SyncThenAsync { i: const 6_i32, a: move _12, b: move _13, c: move _14 }; -+ (((*_182) as variant#14).5: SyncThenAsync) = SyncThenAsync { i: const 6_i32, a: move _12, b: move _13, c: move _14 }; - goto -> bb5; - } - - bb5: { - StorageDead(_14); - goto -> bb6; - } - - bb6: { - StorageDead(_13); - goto -> bb7; - } - - bb7: { - StorageDead(_12); +- StorageDead(_14); +- StorageDead(_13); +- StorageDead(_12); - StorageLive(_15); -+ nop; - StorageLive(_16); - _16 = AsyncInt(const 10_i32); +- StorageLive(_16); +- _16 = AsyncInt(const 10_i32); - _15 = AsyncEnum::A(move _16); -+ (((*_182) as variant#12).6: AsyncEnum) = AsyncEnum::A(move _16); - goto -> bb8; - } - - bb8: { - StorageDead(_16); - StorageLive(_17); - StorageLive(_18); - _18 = AsyncInt(const 11_i32); -- _17 = ManuallyDrop::::new(move _18) -> [return: bb9, unwind: bb42]; -+ _17 = ManuallyDrop::::new(move _18) -> [return: bb9, unwind: bb29]; +- StorageDead(_16); +- StorageLive(_17); +- StorageLive(_18); +- _18 = AsyncInt(const 11_i32); +- _17 = ManuallyDrop::::new(move _18) -> [return: bb1, unwind: bb34]; ++ _184 = move _2 as std::ptr::NonNull> (Transmute); ++ _183 = std::future::ResumeTy(move _184); ++ _182 = copy (_1.0: &mut {async fn body of elaborate_drops()}); ++ _181 = discriminant((*_182)); ++ switchInt(move _181) -> [0: bb162, 1: bb161, 2: bb160, 3: bb142, 4: bb143, 5: bb144, 6: bb145, 7: bb146, 8: bb147, 9: bb148, 10: bb149, 11: bb150, 12: bb151, 13: bb152, 14: bb153, 15: bb154, 16: bb155, 17: bb156, 18: bb157, 19: bb158, 20: bb159, otherwise: bb35]; } - bb9: { + bb1: { StorageDead(_18); - StorageLive(_19); - _19 = AsyncInt(const 12_i32); @@ -412,267 +373,267 @@ - StorageLive(_26); - _26 = {closure@$DIR/async_drop.rs:78:27: 78:35} { foo: move _25 }; - _0 = const (); -- goto -> bb72; +- goto -> bb64; + nop; + (((*_182) as variant#4).10: {async closure@$DIR/async_drop.rs:78:27: 78:35}) = {closure@$DIR/async_drop.rs:78:27: 78:35} { foo: move _25 }; + (((*_182) as variant#20).0: ()) = const (); -+ goto -> bb51; ++ goto -> bb43; } - bb10: { + bb2: { - StorageDead(_26); + nop; - goto -> bb11; + goto -> bb3; } - bb11: { + bb3: { StorageDead(_25); -- goto -> bb92; -+ goto -> bb63; +- goto -> bb84; ++ goto -> bb55; } - bb12: { + bb4: { - StorageDead(_24); + nop; - goto -> bb13; + goto -> bb5; } - bb13: { + bb5: { StorageDead(_23); -- goto -> bb112; -+ goto -> bb75; +- goto -> bb104; ++ goto -> bb67; } - bb14: { + bb6: { - StorageDead(_20); -- goto -> bb132; +- goto -> bb124; + nop; -+ goto -> bb87; ++ goto -> bb79; } - bb15: { + bb7: { - StorageDead(_19); + nop; StorageDead(_17); -- goto -> bb152; -+ goto -> bb99; +- goto -> bb144; ++ goto -> bb91; } - bb16: { + bb8: { - StorageDead(_15); -- goto -> bb172; +- goto -> bb164; + nop; -+ goto -> bb111; ++ goto -> bb103; } - bb17: { + bb9: { - StorageDead(_11); -- goto -> bb192; +- goto -> bb184; + nop; -+ goto -> bb123; ++ goto -> bb115; } - bb18: { + bb10: { - StorageDead(_8); -- goto -> bb212; +- goto -> bb204; + nop; -+ goto -> bb135; ++ goto -> bb127; } - bb19: { + bb11: { - StorageDead(_5); -- goto -> bb232; +- goto -> bb224; + nop; -+ goto -> bb147; ++ goto -> bb139; } - bb20: { + bb12: { - StorageDead(_4); -- drop(_3) -> [return: bb21, unwind: bb50]; +- drop(_3) -> [return: bb13, unwind: bb42]; + nop; -+ drop((((*_182) as variant#20).1: SyncInt)) -> [return: bb21, unwind: bb37]; ++ drop((((*_182) as variant#20).1: SyncInt)) -> [return: bb13, unwind: bb29]; } - bb21: { + bb13: { - StorageDead(_3); -- drop(_1) -> [return: bb22, unwind: bb51]; +- drop(_1) -> [return: bb14, unwind: bb43]; + nop; -+ goto -> bb148; ++ goto -> bb140; } - bb22: { + bb14: { + _0 = Poll::<()>::Ready(move (((*_182) as variant#20).0: ())); + discriminant((*_182)) = 1; return; } -- bb23: { +- bb15: { - StorageDead(_26); -+ bb23 (cleanup): { ++ bb15 (cleanup): { + nop; - goto -> bb24; + goto -> bb16; } -- bb24: { -+ bb24 (cleanup): { +- bb16: { ++ bb16 (cleanup): { StorageDead(_25); -- goto -> bb25; -+ drop((((*_182) as variant#6).9: {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb25, unwind terminate(cleanup)]; +- goto -> bb17; ++ drop((((*_182) as variant#6).9: {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb17, unwind terminate(cleanup)]; } -- bb25: { +- bb17: { - StorageDead(_24); -+ bb25 (cleanup): { ++ bb17 (cleanup): { + nop; - goto -> bb26; + goto -> bb18; } -- bb26: { -+ bb26 (cleanup): { +- bb18: { ++ bb18 (cleanup): { StorageDead(_23); -- goto -> bb27; -+ drop((((*_182) as variant#8).8: AsyncReference<'_>)) -> [return: bb27, unwind terminate(cleanup)]; +- goto -> bb19; ++ drop((((*_182) as variant#8).8: AsyncReference<'_>)) -> [return: bb19, unwind terminate(cleanup)]; } -- bb27: { +- bb19: { - StorageDead(_20); -- goto -> bb28; -+ bb27 (cleanup): { +- goto -> bb20; ++ bb19 (cleanup): { + nop; -+ drop((((*_182) as variant#10).7: AsyncInt)) -> [return: bb28, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#10).7: AsyncInt)) -> [return: bb20, unwind terminate(cleanup)]; } -- bb28: { +- bb20: { - StorageDead(_19); - StorageDead(_17); -- goto -> bb29; -+ bb28 (cleanup): { +- goto -> bb21; ++ bb20 (cleanup): { + nop; -+ goto -> bb31; ++ goto -> bb23; } -- bb29: { +- bb21: { - StorageDead(_15); -+ bb29 (cleanup): { - goto -> bb30; ++ bb21 (cleanup): { + goto -> bb22; } -- bb30: { +- bb22: { - StorageDead(_11); -+ bb30 (cleanup): { ++ bb22 (cleanup): { + StorageDead(_18); - goto -> bb31; + goto -> bb23; } -- bb31: { +- bb23: { - StorageDead(_8); -- goto -> bb32; -+ bb31 (cleanup): { +- goto -> bb24; ++ bb23 (cleanup): { + StorageDead(_17); -+ drop((((*_182) as variant#12).6: AsyncEnum)) -> [return: bb32, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#12).6: AsyncEnum)) -> [return: bb24, unwind terminate(cleanup)]; } -- bb32: { +- bb24: { - StorageDead(_5); -- goto -> bb33; -+ bb32 (cleanup): { +- goto -> bb25; ++ bb24 (cleanup): { + nop; -+ drop((((*_182) as variant#14).5: SyncThenAsync)) -> [return: bb33, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#14).5: SyncThenAsync)) -> [return: bb25, unwind terminate(cleanup)]; } -- bb33: { +- bb25: { - StorageDead(_4); -- goto -> bb34; -+ bb33 (cleanup): { +- goto -> bb26; ++ bb25 (cleanup): { + nop; -+ drop((((*_182) as variant#16).4: AsyncStruct)) -> [return: bb34, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#16).4: AsyncStruct)) -> [return: bb26, unwind terminate(cleanup)]; } -- bb34: { +- bb26: { - StorageDead(_3); -- goto -> bb35; -+ bb34 (cleanup): { +- goto -> bb27; ++ bb26 (cleanup): { + nop; -+ drop((((*_182) as variant#18).3: [AsyncInt; 2])) -> [return: bb35, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#18).3: [AsyncInt; 2])) -> [return: bb27, unwind terminate(cleanup)]; } -- bb35: { +- bb27: { - coroutine_drop; -+ bb35 (cleanup): { ++ bb27 (cleanup): { + nop; -+ drop((((*_182) as variant#20).2: AsyncInt)) -> [return: bb36, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#20).2: AsyncInt)) -> [return: bb28, unwind terminate(cleanup)]; } - bb36 (cleanup): { + bb28 (cleanup): { - StorageDead(_26); -- goto -> bb37; +- goto -> bb29; + nop; -+ drop((((*_182) as variant#20).1: SyncInt)) -> [return: bb37, unwind terminate(cleanup)]; ++ drop((((*_182) as variant#20).1: SyncInt)) -> [return: bb29, unwind terminate(cleanup)]; } - bb37 (cleanup): { + bb29 (cleanup): { - StorageDead(_25); -- drop(_24) -> [return: bb38, unwind terminate(cleanup)]; +- drop(_24) -> [return: bb30, unwind terminate(cleanup)]; + nop; -+ goto -> bb38; ++ goto -> bb30; } - bb38 (cleanup): { + bb30 (cleanup): { - StorageDead(_24); -- goto -> bb39; -+ goto -> bb149; +- goto -> bb31; ++ goto -> bb141; } -- bb39 (cleanup): { +- bb31 (cleanup): { - StorageDead(_23); -- drop(_20) -> [return: bb40, unwind terminate(cleanup)]; -+ bb39: { +- drop(_20) -> [return: bb32, unwind terminate(cleanup)]; ++ bb31: { + nop; -+ goto -> bb10; ++ goto -> bb2; } - bb40 (cleanup): { + bb32 (cleanup): { - StorageDead(_20); -- drop(_19) -> [return: bb41, unwind terminate(cleanup)]; +- drop(_19) -> [return: bb33, unwind terminate(cleanup)]; + nop; -+ goto -> bb23; ++ goto -> bb15; } -- bb41 (cleanup): { +- bb33 (cleanup): { - StorageDead(_19); -- goto -> bb44; -+ bb41: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb41, unwind: bb40]; +- goto -> bb36; ++ bb33: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb33, unwind: bb32]; } -- bb42 (cleanup): { -- goto -> bb43; -+ bb42: { +- bb34 (cleanup): { +- goto -> bb35; ++ bb34: { + _183 = move _28; + StorageDead(_28); -+ goto -> bb41; ++ goto -> bb33; } -- bb43 (cleanup): { +- bb35 (cleanup): { - StorageDead(_18); -- goto -> bb44; -+ bb43: { +- goto -> bb36; ++ bb35: { + unreachable; } -- bb44 (cleanup): { +- bb36 (cleanup): { - StorageDead(_17); -- drop(_15) -> [return: bb45, unwind terminate(cleanup)]; -+ bb44: { +- drop(_15) -> [return: bb37, unwind terminate(cleanup)]; ++ bb36: { + _183 = move _35; + StorageDead(_35); -+ goto -> bb49; ++ goto -> bb41; } -- bb45 (cleanup): { +- bb37 (cleanup): { - StorageDead(_15); -- drop(_11) -> [return: bb46, unwind terminate(cleanup)]; -+ bb45: { +- drop(_11) -> [return: bb38, unwind terminate(cleanup)]; ++ bb37: { + StorageLive(_35); + _0 = Poll::<()>::Pending; + StorageDead(_17); @@ -683,95 +644,95 @@ + return; } -- bb46 (cleanup): { +- bb38 (cleanup): { - StorageDead(_11); -- drop(_8) -> [return: bb47, unwind terminate(cleanup)]; -+ bb46: { +- drop(_8) -> [return: bb39, unwind terminate(cleanup)]; ++ bb38: { + _37 = discriminant(_36); -+ switchInt(move _37) -> [0: bb39, 1: bb45, otherwise: bb43]; ++ switchInt(move _37) -> [0: bb31, 1: bb37, otherwise: bb35]; } -- bb47 (cleanup): { +- bb39 (cleanup): { - StorageDead(_8); -- drop(_5) -> [return: bb48, unwind terminate(cleanup)]; -+ bb47: { -+ _36 = as Future>::poll(move _38, move _39) -> [return: bb46, unwind: bb40]; +- drop(_5) -> [return: bb40, unwind terminate(cleanup)]; ++ bb39: { ++ _36 = as Future>::poll(move _38, move _39) -> [return: bb38, unwind: bb32]; } -- bb48 (cleanup): { +- bb40 (cleanup): { - StorageDead(_5); -- drop(_4) -> [return: bb49, unwind terminate(cleanup)]; -+ bb48: { +- drop(_4) -> [return: bb41, unwind terminate(cleanup)]; ++ bb40: { + _40 = move _183; + _39 = copy (_40.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb47; ++ goto -> bb39; } -- bb49 (cleanup): { +- bb41 (cleanup): { - StorageDead(_4); -- drop(_3) -> [return: bb50, unwind terminate(cleanup)]; -+ bb49: { +- drop(_3) -> [return: bb42, unwind terminate(cleanup)]; ++ bb41: { + _41 = &mut (((*_182) as variant#4).11: impl std::future::Future); -+ _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb48, unwind: bb40]; ++ _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb40, unwind: bb32]; } -- bb50 (cleanup): { +- bb42 (cleanup): { - StorageDead(_3); -- drop(_1) -> [return: bb51, unwind terminate(cleanup)]; -+ bb50: { +- drop(_1) -> [return: bb43, unwind terminate(cleanup)]; ++ bb42: { + nop; -+ (((*_182) as variant#4).11: impl std::future::Future) = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb49, unwind: bb40]; ++ (((*_182) as variant#4).11: impl std::future::Future) = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb41, unwind: bb32]; } -- bb51 (cleanup): { +- bb43 (cleanup): { - resume; -+ bb51: { ++ bb43: { + _43 = &mut (((*_182) as variant#4).10: {async closure@$DIR/async_drop.rs:78:27: 78:35}); -+ _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb50, unwind: bb23]; ++ _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb42, unwind: bb15]; } - bb52: { + bb44: { - StorageDead(_27); -- goto -> bb10; +- goto -> bb2; + nop; -+ goto -> bb12; ++ goto -> bb4; } -- bb53: { +- bb45: { - StorageDead(_27); -- goto -> bb23; -+ bb53 (cleanup): { +- goto -> bb15; ++ bb45 (cleanup): { + nop; -+ goto -> bb25; ++ goto -> bb17; } -- bb54 (cleanup): { +- bb46 (cleanup): { - StorageDead(_27); -- goto -> bb36; -+ bb54: { -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb54, unwind: bb53]; +- goto -> bb28; ++ bb46: { ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb46, unwind: bb45]; } - bb55: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb55, unwind: bb54]; + bb47: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb47, unwind: bb46]; + _183 = move _45; + StorageDead(_45); -+ goto -> bb54; ++ goto -> bb46; } - bb56: { + bb48: { - _2 = move _28; - StorageDead(_28); -- goto -> bb55; +- goto -> bb47; + _183 = move _52; + StorageDead(_52); -+ goto -> bb61; ++ goto -> bb53; } - bb57: { + bb49: { - _2 = move _28; - StorageDead(_28); -- goto -> bb63; +- goto -> bb55; + StorageLive(_52); + _0 = Poll::<()>::Pending; + StorageDead(_17); @@ -781,87 +742,87 @@ + return; } - bb58: { + bb50: { - StorageLive(_28); -- _28 = yield(const ()) -> [resume: bb56, drop: bb57]; +- _28 = yield(const ()) -> [resume: bb48, drop: bb49]; + _54 = discriminant(_53); -+ switchInt(move _54) -> [0: bb52, 1: bb57, otherwise: bb43]; ++ switchInt(move _54) -> [0: bb44, 1: bb49, otherwise: bb35]; } - bb59: { + bb51: { - unreachable; -+ _53 = as Future>::poll(move _55, move _56) -> [return: bb58, unwind: bb53]; ++ _53 = as Future>::poll(move _55, move _56) -> [return: bb50, unwind: bb45]; } - bb60: { + bb52: { - _30 = discriminant(_29); -- switchInt(move _30) -> [0: bb53, 1: bb58, otherwise: bb59]; +- switchInt(move _30) -> [0: bb45, 1: bb50, otherwise: bb51]; + _57 = move _183; + _56 = copy (_57.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb59; ++ goto -> bb51; } - bb61: { -- _29 = as Future>::poll(move _31, move _32) -> [return: bb60, unwind: bb54]; + bb53: { +- _29 = as Future>::poll(move _31, move _32) -> [return: bb52, unwind: bb46]; + _58 = &mut (((*_182) as variant#6).10: impl std::future::Future); -+ _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb60, unwind: bb53]; ++ _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb52, unwind: bb45]; } - bb62: { + bb54: { - _33 = move _2; -- _32 = std::future::get_context::<'_, '_>(move _33) -> [return: bb61, unwind: bb54]; +- _32 = std::future::get_context::<'_, '_>(move _33) -> [return: bb53, unwind: bb46]; + nop; -+ (((*_182) as variant#6).10: impl std::future::Future) = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb61, unwind: bb53]; ++ (((*_182) as variant#6).10: impl std::future::Future) = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb53, unwind: bb45]; } - bb63: { + bb55: { - _34 = &mut _27; -- _31 = Pin::<&mut impl Future>::new_unchecked(move _34) -> [return: bb62, unwind: bb54]; +- _31 = Pin::<&mut impl Future>::new_unchecked(move _34) -> [return: bb54, unwind: bb46]; + _60 = &mut (((*_182) as variant#6).9: {closure@$DIR/async_drop.rs:70:25: 70:27}); -+ _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb62, unwind: bb25]; ++ _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb54, unwind: bb17]; } - bb64: { + bb56: { - _2 = move _35; - StorageDead(_35); -- goto -> bb70; +- goto -> bb62; + nop; -+ goto -> bb14; ++ goto -> bb6; } -- bb65: { +- bb57: { - _2 = move _35; - StorageDead(_35); -- goto -> bb63; -+ bb65 (cleanup): { +- goto -> bb55; ++ bb57 (cleanup): { + nop; -+ goto -> bb27; ++ goto -> bb19; } - bb66: { + bb58: { - StorageLive(_35); -- _35 = yield(const ()) -> [resume: bb64, drop: bb65]; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb66, unwind: bb65]; +- _35 = yield(const ()) -> [resume: bb56, drop: bb57]; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb58, unwind: bb57]; } - bb67: { + bb59: { - _37 = discriminant(_36); -- switchInt(move _37) -> [0: bb52, 1: bb66, otherwise: bb59]; +- switchInt(move _37) -> [0: bb44, 1: bb58, otherwise: bb51]; + _183 = move _62; + StorageDead(_62); -+ goto -> bb66; ++ goto -> bb58; } - bb68: { -- _36 = as Future>::poll(move _38, move _39) -> [return: bb67, unwind: bb54]; + bb60: { +- _36 = as Future>::poll(move _38, move _39) -> [return: bb59, unwind: bb46]; + _183 = move _69; + StorageDead(_69); -+ goto -> bb73; ++ goto -> bb65; } - bb69: { + bb61: { - _40 = move _2; -- _39 = std::future::get_context::<'_, '_>(move _40) -> [return: bb68, unwind: bb54]; +- _39 = std::future::get_context::<'_, '_>(move _40) -> [return: bb60, unwind: bb46]; + StorageLive(_69); + _0 = Poll::<()>::Pending; + StorageDead(_17); @@ -870,89 +831,89 @@ + return; } - bb70: { + bb62: { - _41 = &mut _27; -- _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb69, unwind: bb54]; +- _38 = Pin::<&mut impl Future>::new_unchecked(move _41) -> [return: bb61, unwind: bb46]; + _71 = discriminant(_70); -+ switchInt(move _71) -> [0: bb64, 1: bb69, otherwise: bb43]; ++ switchInt(move _71) -> [0: bb56, 1: bb61, otherwise: bb35]; } - bb71: { + bb63: { - StorageLive(_27); -- _27 = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb70, unwind: bb54]; -+ _70 = as Future>::poll(move _72, move _73) -> [return: bb70, unwind: bb65]; +- _27 = async_drop_in_place::<{async closure@$DIR/async_drop.rs:78:27: 78:35}>(copy (_42.0: &mut {async closure@$DIR/async_drop.rs:78:27: 78:35})) -> [return: bb62, unwind: bb46]; ++ _70 = as Future>::poll(move _72, move _73) -> [return: bb62, unwind: bb57]; } - bb72: { + bb64: { - _43 = &mut _26; -- _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb71, unwind: bb36]; +- _42 = Pin::<&mut {async closure@$DIR/async_drop.rs:78:27: 78:35}>::new_unchecked(move _43) -> [return: bb63, unwind: bb28]; + _74 = move _183; + _73 = copy (_74.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb71; ++ goto -> bb63; } - bb73: { + bb65: { - StorageDead(_44); -- goto -> bb12; +- goto -> bb4; + _75 = &mut (((*_182) as variant#8).9: impl std::future::Future); -+ _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb72, unwind: bb65]; ++ _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb64, unwind: bb57]; } - bb74: { + bb66: { - StorageDead(_44); -- goto -> bb25; +- goto -> bb17; + nop; -+ (((*_182) as variant#8).9: impl std::future::Future) = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb73, unwind: bb65]; ++ (((*_182) as variant#8).9: impl std::future::Future) = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb65, unwind: bb57]; } -- bb75 (cleanup): { +- bb67 (cleanup): { - StorageDead(_44); -- goto -> bb38; -+ bb75: { +- goto -> bb30; ++ bb67: { + _77 = &mut (((*_182) as variant#8).8: AsyncReference<'_>); -+ _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb74, unwind: bb27]; ++ _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb66, unwind: bb19]; } - bb76: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb76, unwind: bb75]; + bb68: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb68, unwind: bb67]; + nop; -+ goto -> bb15; ++ goto -> bb7; } -- bb77: { +- bb69: { - _2 = move _45; - StorageDead(_45); -- goto -> bb76; -+ bb77 (cleanup): { +- goto -> bb68; ++ bb69 (cleanup): { + nop; -+ goto -> bb28; ++ goto -> bb20; } - bb78: { + bb70: { - _2 = move _45; - StorageDead(_45); -- goto -> bb83; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb78, unwind: bb77]; +- goto -> bb75; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb70, unwind: bb69]; } - bb79: { + bb71: { - StorageLive(_45); -- _45 = yield(const ()) -> [resume: bb77, drop: bb78]; +- _45 = yield(const ()) -> [resume: bb69, drop: bb70]; + _183 = move _79; + StorageDead(_79); -+ goto -> bb78; ++ goto -> bb70; } - bb80: { + bb72: { - _47 = discriminant(_46); -- switchInt(move _47) -> [0: bb74, 1: bb79, otherwise: bb59]; +- switchInt(move _47) -> [0: bb66, 1: bb71, otherwise: bb51]; + _183 = move _86; + StorageDead(_86); -+ goto -> bb85; ++ goto -> bb77; } - bb81: { -- _46 = as Future>::poll(move _48, move _49) -> [return: bb80, unwind: bb75]; + bb73: { +- _46 = as Future>::poll(move _48, move _49) -> [return: bb72, unwind: bb67]; + StorageLive(_86); + _0 = Poll::<()>::Pending; + StorageDead(_17); @@ -961,89 +922,89 @@ + return; } - bb82: { + bb74: { - _50 = move _2; -- _49 = std::future::get_context::<'_, '_>(move _50) -> [return: bb81, unwind: bb75]; +- _49 = std::future::get_context::<'_, '_>(move _50) -> [return: bb73, unwind: bb67]; + _88 = discriminant(_87); -+ switchInt(move _88) -> [0: bb76, 1: bb81, otherwise: bb43]; ++ switchInt(move _88) -> [0: bb68, 1: bb73, otherwise: bb35]; } - bb83: { + bb75: { - _51 = &mut _44; -- _48 = Pin::<&mut impl Future>::new_unchecked(move _51) -> [return: bb82, unwind: bb75]; -+ _87 = as Future>::poll(move _89, move _90) -> [return: bb82, unwind: bb77]; +- _48 = Pin::<&mut impl Future>::new_unchecked(move _51) -> [return: bb74, unwind: bb67]; ++ _87 = as Future>::poll(move _89, move _90) -> [return: bb74, unwind: bb69]; } - bb84: { + bb76: { - _2 = move _52; - StorageDead(_52); -- goto -> bb90; +- goto -> bb82; + _91 = move _183; + _90 = copy (_91.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb83; ++ goto -> bb75; } - bb85: { + bb77: { - _2 = move _52; - StorageDead(_52); -- goto -> bb83; +- goto -> bb75; + _92 = &mut (((*_182) as variant#10).8: impl std::future::Future); -+ _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb84, unwind: bb77]; ++ _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb76, unwind: bb69]; } - bb86: { + bb78: { - StorageLive(_52); -- _52 = yield(const ()) -> [resume: bb84, drop: bb85]; +- _52 = yield(const ()) -> [resume: bb76, drop: bb77]; + nop; -+ (((*_182) as variant#10).8: impl std::future::Future) = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb85, unwind: bb77]; ++ (((*_182) as variant#10).8: impl std::future::Future) = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb77, unwind: bb69]; } - bb87: { + bb79: { - _54 = discriminant(_53); -- switchInt(move _54) -> [0: bb73, 1: bb86, otherwise: bb59]; +- switchInt(move _54) -> [0: bb65, 1: bb78, otherwise: bb51]; + _94 = &mut (((*_182) as variant#10).7: AsyncInt); -+ _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb86, unwind: bb28]; ++ _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb78, unwind: bb20]; } - bb88: { -- _53 = as Future>::poll(move _55, move _56) -> [return: bb87, unwind: bb75]; + bb80: { +- _53 = as Future>::poll(move _55, move _56) -> [return: bb79, unwind: bb67]; + nop; -+ goto -> bb16; ++ goto -> bb8; } -- bb89: { +- bb81: { - _57 = move _2; -- _56 = std::future::get_context::<'_, '_>(move _57) -> [return: bb88, unwind: bb75]; -+ bb89 (cleanup): { +- _56 = std::future::get_context::<'_, '_>(move _57) -> [return: bb80, unwind: bb67]; ++ bb81 (cleanup): { + nop; -+ goto -> bb32; ++ goto -> bb24; } - bb90: { + bb82: { - _58 = &mut _44; -- _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb89, unwind: bb75]; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb90, unwind: bb89]; +- _55 = Pin::<&mut impl Future>::new_unchecked(move _58) -> [return: bb81, unwind: bb67]; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb82, unwind: bb81]; } - bb91: { + bb83: { - StorageLive(_44); -- _44 = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb90, unwind: bb75]; +- _44 = async_drop_in_place::<{closure@$DIR/async_drop.rs:70:25: 70:27}>(copy (_59.0: &mut {closure@$DIR/async_drop.rs:70:25: 70:27})) -> [return: bb82, unwind: bb67]; + _183 = move _96; + StorageDead(_96); -+ goto -> bb90; ++ goto -> bb82; } - bb92: { + bb84: { - _60 = &mut _24; -- _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb91, unwind: bb38]; +- _59 = Pin::<&mut {closure@$DIR/async_drop.rs:70:25: 70:27}>::new_unchecked(move _60) -> [return: bb83, unwind: bb30]; + _183 = move _103; + StorageDead(_103); -+ goto -> bb97; ++ goto -> bb89; } - bb93: { + bb85: { - StorageDead(_61); -- goto -> bb14; +- goto -> bb6; + StorageLive(_103); + _0 = Poll::<()>::Pending; + StorageDead(_103); @@ -1051,91 +1012,91 @@ + return; } - bb94: { + bb86: { - StorageDead(_61); -- goto -> bb27; +- goto -> bb19; + _105 = discriminant(_104); -+ switchInt(move _105) -> [0: bb88, 1: bb93, otherwise: bb43]; ++ switchInt(move _105) -> [0: bb80, 1: bb85, otherwise: bb35]; } -- bb95 (cleanup): { +- bb87 (cleanup): { - StorageDead(_61); -- goto -> bb40; -+ bb95: { -+ _104 = as Future>::poll(move _106, move _107) -> [return: bb94, unwind: bb89]; +- goto -> bb32; ++ bb87: { ++ _104 = as Future>::poll(move _106, move _107) -> [return: bb86, unwind: bb81]; } - bb96: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb96, unwind: bb95]; + bb88: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb88, unwind: bb87]; + _108 = move _183; + _107 = copy (_108.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb95; ++ goto -> bb87; } - bb97: { + bb89: { - _2 = move _62; - StorageDead(_62); -- goto -> bb96; +- goto -> bb88; + _109 = &mut (((*_182) as variant#12).7: impl std::future::Future); -+ _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb96, unwind: bb89]; ++ _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb88, unwind: bb81]; } - bb98: { + bb90: { - _2 = move _62; - StorageDead(_62); -- goto -> bb103; +- goto -> bb95; + nop; -+ (((*_182) as variant#12).7: impl std::future::Future) = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb97, unwind: bb89]; ++ (((*_182) as variant#12).7: impl std::future::Future) = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb89, unwind: bb81]; } - bb99: { + bb91: { - StorageLive(_62); -- _62 = yield(const ()) -> [resume: bb97, drop: bb98]; +- _62 = yield(const ()) -> [resume: bb89, drop: bb90]; + _111 = &mut (((*_182) as variant#12).6: AsyncEnum); -+ _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb98, unwind: bb32]; ++ _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb90, unwind: bb24]; } - bb100: { + bb92: { - _64 = discriminant(_63); -- switchInt(move _64) -> [0: bb94, 1: bb99, otherwise: bb59]; +- switchInt(move _64) -> [0: bb86, 1: bb91, otherwise: bb51]; + nop; -+ goto -> bb17; ++ goto -> bb9; } -- bb101: { -- _63 = as Future>::poll(move _65, move _66) -> [return: bb100, unwind: bb95]; -+ bb101 (cleanup): { +- bb93: { +- _63 = as Future>::poll(move _65, move _66) -> [return: bb92, unwind: bb87]; ++ bb93 (cleanup): { + nop; -+ goto -> bb33; ++ goto -> bb25; } - bb102: { + bb94: { - _67 = move _2; -- _66 = std::future::get_context::<'_, '_>(move _67) -> [return: bb101, unwind: bb95]; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb102, unwind: bb101]; +- _66 = std::future::get_context::<'_, '_>(move _67) -> [return: bb93, unwind: bb87]; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb94, unwind: bb93]; } - bb103: { + bb95: { - _68 = &mut _61; -- _65 = Pin::<&mut impl Future>::new_unchecked(move _68) -> [return: bb102, unwind: bb95]; +- _65 = Pin::<&mut impl Future>::new_unchecked(move _68) -> [return: bb94, unwind: bb87]; + _183 = move _113; + StorageDead(_113); -+ goto -> bb102; ++ goto -> bb94; } - bb104: { + bb96: { - _2 = move _69; - StorageDead(_69); -- goto -> bb110; +- goto -> bb102; + _183 = move _120; + StorageDead(_120); -+ goto -> bb109; ++ goto -> bb101; } - bb105: { + bb97: { - _2 = move _69; - StorageDead(_69); -- goto -> bb103; +- goto -> bb95; + StorageLive(_120); + _0 = Poll::<()>::Pending; + StorageDead(_120); @@ -1143,88 +1104,88 @@ + return; } - bb106: { + bb98: { - StorageLive(_69); -- _69 = yield(const ()) -> [resume: bb104, drop: bb105]; +- _69 = yield(const ()) -> [resume: bb96, drop: bb97]; + _122 = discriminant(_121); -+ switchInt(move _122) -> [0: bb100, 1: bb105, otherwise: bb43]; ++ switchInt(move _122) -> [0: bb92, 1: bb97, otherwise: bb35]; } - bb107: { + bb99: { - _71 = discriminant(_70); -- switchInt(move _71) -> [0: bb93, 1: bb106, otherwise: bb59]; -+ _121 = as Future>::poll(move _123, move _124) -> [return: bb106, unwind: bb101]; +- switchInt(move _71) -> [0: bb85, 1: bb98, otherwise: bb51]; ++ _121 = as Future>::poll(move _123, move _124) -> [return: bb98, unwind: bb93]; } - bb108: { -- _70 = as Future>::poll(move _72, move _73) -> [return: bb107, unwind: bb95]; + bb100: { +- _70 = as Future>::poll(move _72, move _73) -> [return: bb99, unwind: bb87]; + _125 = move _183; + _124 = copy (_125.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb107; ++ goto -> bb99; } - bb109: { + bb101: { - _74 = move _2; -- _73 = std::future::get_context::<'_, '_>(move _74) -> [return: bb108, unwind: bb95]; +- _73 = std::future::get_context::<'_, '_>(move _74) -> [return: bb100, unwind: bb87]; + _126 = &mut (((*_182) as variant#14).6: impl std::future::Future); -+ _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb108, unwind: bb101]; ++ _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb100, unwind: bb93]; } - bb110: { + bb102: { - _75 = &mut _61; -- _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb109, unwind: bb95]; +- _72 = Pin::<&mut impl Future>::new_unchecked(move _75) -> [return: bb101, unwind: bb87]; + nop; -+ (((*_182) as variant#14).6: impl std::future::Future) = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb109, unwind: bb101]; ++ (((*_182) as variant#14).6: impl std::future::Future) = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb101, unwind: bb93]; } - bb111: { + bb103: { - StorageLive(_61); -- _61 = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb110, unwind: bb95]; +- _61 = async_drop_in_place::>(copy (_76.0: &mut AsyncReference<'_>)) -> [return: bb102, unwind: bb87]; + _128 = &mut (((*_182) as variant#14).5: SyncThenAsync); -+ _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb110, unwind: bb33]; ++ _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb102, unwind: bb25]; } - bb112: { + bb104: { - _77 = &mut _20; -- _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb111, unwind: bb40]; +- _76 = Pin::<&mut AsyncReference<'_>>::new_unchecked(move _77) -> [return: bb103, unwind: bb32]; + nop; -+ goto -> bb18; ++ goto -> bb10; } -- bb113: { +- bb105: { - StorageDead(_78); -- goto -> bb15; -+ bb113 (cleanup): { +- goto -> bb7; ++ bb105 (cleanup): { + nop; -+ goto -> bb34; ++ goto -> bb26; } - bb114: { + bb106: { - StorageDead(_78); -- goto -> bb28; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb114, unwind: bb113]; +- goto -> bb20; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb106, unwind: bb105]; } -- bb115 (cleanup): { +- bb107 (cleanup): { - StorageDead(_78); -- goto -> bb41; -+ bb115: { +- goto -> bb33; ++ bb107: { + _183 = move _130; + StorageDead(_130); -+ goto -> bb114; ++ goto -> bb106; } - bb116: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb116, unwind: bb115]; + bb108: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb108, unwind: bb107]; + _183 = move _137; + StorageDead(_137); -+ goto -> bb121; ++ goto -> bb113; } - bb117: { + bb109: { - _2 = move _79; - StorageDead(_79); -- goto -> bb116; +- goto -> bb108; + StorageLive(_137); + _0 = Poll::<()>::Pending; + StorageDead(_137); @@ -1232,89 +1193,89 @@ + return; } - bb118: { + bb110: { - _2 = move _79; - StorageDead(_79); -- goto -> bb123; +- goto -> bb115; + _139 = discriminant(_138); -+ switchInt(move _139) -> [0: bb112, 1: bb117, otherwise: bb43]; ++ switchInt(move _139) -> [0: bb104, 1: bb109, otherwise: bb35]; } - bb119: { + bb111: { - StorageLive(_79); -- _79 = yield(const ()) -> [resume: bb117, drop: bb118]; -+ _138 = as Future>::poll(move _140, move _141) -> [return: bb118, unwind: bb113]; +- _79 = yield(const ()) -> [resume: bb109, drop: bb110]; ++ _138 = as Future>::poll(move _140, move _141) -> [return: bb110, unwind: bb105]; } - bb120: { + bb112: { - _81 = discriminant(_80); -- switchInt(move _81) -> [0: bb114, 1: bb119, otherwise: bb59]; +- switchInt(move _81) -> [0: bb106, 1: bb111, otherwise: bb51]; + _142 = move _183; + _141 = copy (_142.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb119; ++ goto -> bb111; } - bb121: { -- _80 = as Future>::poll(move _82, move _83) -> [return: bb120, unwind: bb115]; + bb113: { +- _80 = as Future>::poll(move _82, move _83) -> [return: bb112, unwind: bb107]; + _143 = &mut (((*_182) as variant#16).5: impl std::future::Future); -+ _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb120, unwind: bb113]; ++ _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb112, unwind: bb105]; } - bb122: { + bb114: { - _84 = move _2; -- _83 = std::future::get_context::<'_, '_>(move _84) -> [return: bb121, unwind: bb115]; +- _83 = std::future::get_context::<'_, '_>(move _84) -> [return: bb113, unwind: bb107]; + nop; -+ (((*_182) as variant#16).5: impl std::future::Future) = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb121, unwind: bb113]; ++ (((*_182) as variant#16).5: impl std::future::Future) = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb113, unwind: bb105]; } - bb123: { + bb115: { - _85 = &mut _78; -- _82 = Pin::<&mut impl Future>::new_unchecked(move _85) -> [return: bb122, unwind: bb115]; +- _82 = Pin::<&mut impl Future>::new_unchecked(move _85) -> [return: bb114, unwind: bb107]; + _145 = &mut (((*_182) as variant#16).4: AsyncStruct); -+ _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb122, unwind: bb34]; ++ _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb114, unwind: bb26]; } - bb124: { + bb116: { - _2 = move _86; - StorageDead(_86); -- goto -> bb130; +- goto -> bb122; + nop; -+ goto -> bb19; ++ goto -> bb11; } -- bb125: { +- bb117: { - _2 = move _86; - StorageDead(_86); -- goto -> bb123; -+ bb125 (cleanup): { +- goto -> bb115; ++ bb117 (cleanup): { + nop; -+ goto -> bb35; ++ goto -> bb27; } - bb126: { + bb118: { - StorageLive(_86); -- _86 = yield(const ()) -> [resume: bb124, drop: bb125]; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb126, unwind: bb125]; +- _86 = yield(const ()) -> [resume: bb116, drop: bb117]; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb118, unwind: bb117]; } - bb127: { + bb119: { - _88 = discriminant(_87); -- switchInt(move _88) -> [0: bb113, 1: bb126, otherwise: bb59]; +- switchInt(move _88) -> [0: bb105, 1: bb118, otherwise: bb51]; + _183 = move _147; + StorageDead(_147); -+ goto -> bb126; ++ goto -> bb118; } - bb128: { -- _87 = as Future>::poll(move _89, move _90) -> [return: bb127, unwind: bb115]; + bb120: { +- _87 = as Future>::poll(move _89, move _90) -> [return: bb119, unwind: bb107]; + _183 = move _154; + StorageDead(_154); -+ goto -> bb133; ++ goto -> bb125; } - bb129: { + bb121: { - _91 = move _2; -- _90 = std::future::get_context::<'_, '_>(move _91) -> [return: bb128, unwind: bb115]; +- _90 = std::future::get_context::<'_, '_>(move _91) -> [return: bb120, unwind: bb107]; + StorageLive(_154); + _0 = Poll::<()>::Pending; + StorageDead(_154); @@ -1322,89 +1283,89 @@ + return; } - bb130: { + bb122: { - _92 = &mut _78; -- _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb129, unwind: bb115]; +- _89 = Pin::<&mut impl Future>::new_unchecked(move _92) -> [return: bb121, unwind: bb107]; + _156 = discriminant(_155); -+ switchInt(move _156) -> [0: bb124, 1: bb129, otherwise: bb43]; ++ switchInt(move _156) -> [0: bb116, 1: bb121, otherwise: bb35]; } - bb131: { + bb123: { - StorageLive(_78); -- _78 = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb130, unwind: bb115]; -+ _155 = as Future>::poll(move _157, move _158) -> [return: bb130, unwind: bb125]; +- _78 = async_drop_in_place::(copy (_93.0: &mut AsyncInt)) -> [return: bb122, unwind: bb107]; ++ _155 = as Future>::poll(move _157, move _158) -> [return: bb122, unwind: bb117]; } - bb132: { + bb124: { - _94 = &mut _19; -- _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb131, unwind: bb41]; +- _93 = Pin::<&mut AsyncInt>::new_unchecked(move _94) -> [return: bb123, unwind: bb33]; + _159 = move _183; + _158 = copy (_159.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb131; ++ goto -> bb123; } - bb133: { + bb125: { - StorageDead(_95); -- goto -> bb16; +- goto -> bb8; + _160 = &mut (((*_182) as variant#18).4: impl std::future::Future); -+ _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb132, unwind: bb125]; ++ _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb124, unwind: bb117]; } - bb134: { + bb126: { - StorageDead(_95); -- goto -> bb29; +- goto -> bb21; + nop; -+ (((*_182) as variant#18).4: impl std::future::Future) = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb133, unwind: bb125]; ++ (((*_182) as variant#18).4: impl std::future::Future) = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb125, unwind: bb117]; } -- bb135 (cleanup): { +- bb127 (cleanup): { - StorageDead(_95); -- goto -> bb45; -+ bb135: { +- goto -> bb37; ++ bb127: { + _162 = &mut (((*_182) as variant#18).3: [AsyncInt; 2]); -+ _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb134, unwind: bb35]; ++ _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb126, unwind: bb27]; } - bb136: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb136, unwind: bb135]; + bb128: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb128, unwind: bb127]; + nop; -+ goto -> bb20; ++ goto -> bb12; } -- bb137: { +- bb129: { - _2 = move _96; - StorageDead(_96); -- goto -> bb136; -+ bb137 (cleanup): { +- goto -> bb128; ++ bb129 (cleanup): { + nop; -+ goto -> bb36; ++ goto -> bb28; } - bb138: { + bb130: { - _2 = move _96; - StorageDead(_96); -- goto -> bb143; -+ assert(const false, "`async fn` resumed after async drop") -> [success: bb138, unwind: bb137]; +- goto -> bb135; ++ assert(const false, "`async fn` resumed after async drop") -> [success: bb130, unwind: bb129]; } - bb139: { + bb131: { - StorageLive(_96); -- _96 = yield(const ()) -> [resume: bb137, drop: bb138]; +- _96 = yield(const ()) -> [resume: bb129, drop: bb130]; + _183 = move _164; + StorageDead(_164); -+ goto -> bb138; ++ goto -> bb130; } - bb140: { + bb132: { - _98 = discriminant(_97); -- switchInt(move _98) -> [0: bb134, 1: bb139, otherwise: bb59]; +- switchInt(move _98) -> [0: bb126, 1: bb131, otherwise: bb51]; + _183 = move _171; + StorageDead(_171); -+ goto -> bb145; ++ goto -> bb137; } - bb141: { -- _97 = as Future>::poll(move _99, move _100) -> [return: bb140, unwind: bb135]; + bb133: { +- _97 = as Future>::poll(move _99, move _100) -> [return: bb132, unwind: bb127]; + StorageLive(_171); + _0 = Poll::<()>::Pending; + StorageDead(_171); @@ -1412,551 +1373,551 @@ + return; } - bb142: { + bb134: { - _101 = move _2; -- _100 = std::future::get_context::<'_, '_>(move _101) -> [return: bb141, unwind: bb135]; +- _100 = std::future::get_context::<'_, '_>(move _101) -> [return: bb133, unwind: bb127]; + _173 = discriminant(_172); -+ switchInt(move _173) -> [0: bb136, 1: bb141, otherwise: bb43]; ++ switchInt(move _173) -> [0: bb128, 1: bb133, otherwise: bb35]; } - bb143: { + bb135: { - _102 = &mut _95; -- _99 = Pin::<&mut impl Future>::new_unchecked(move _102) -> [return: bb142, unwind: bb135]; -+ _172 = as Future>::poll(move _174, move _175) -> [return: bb142, unwind: bb137]; +- _99 = Pin::<&mut impl Future>::new_unchecked(move _102) -> [return: bb134, unwind: bb127]; ++ _172 = as Future>::poll(move _174, move _175) -> [return: bb134, unwind: bb129]; } - bb144: { + bb136: { - _2 = move _103; - StorageDead(_103); -- goto -> bb150; +- goto -> bb142; + _176 = move _183; + _175 = copy (_176.0: std::ptr::NonNull>) as &mut std::task::Context<'_> (Transmute); -+ goto -> bb143; ++ goto -> bb135; } - bb145: { + bb137: { - _2 = move _103; - StorageDead(_103); -- goto -> bb143; +- goto -> bb135; + _177 = &mut (((*_182) as variant#20).3: impl std::future::Future); -+ _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb144, unwind: bb137]; ++ _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb136, unwind: bb129]; } - bb146: { + bb138: { - StorageLive(_103); -- _103 = yield(const ()) -> [resume: bb144, drop: bb145]; +- _103 = yield(const ()) -> [resume: bb136, drop: bb137]; + nop; -+ (((*_182) as variant#20).3: impl std::future::Future) = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb145, unwind: bb137]; ++ (((*_182) as variant#20).3: impl std::future::Future) = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb137, unwind: bb129]; } - bb147: { + bb139: { - _105 = discriminant(_104); -- switchInt(move _105) -> [0: bb133, 1: bb146, otherwise: bb59]; +- switchInt(move _105) -> [0: bb125, 1: bb138, otherwise: bb51]; + _179 = &mut (((*_182) as variant#20).2: AsyncInt); -+ _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb146, unwind: bb36]; ++ _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb138, unwind: bb28]; } - bb148: { -- _104 = as Future>::poll(move _106, move _107) -> [return: bb147, unwind: bb135]; -+ goto -> bb22; + bb140: { +- _104 = as Future>::poll(move _106, move _107) -> [return: bb139, unwind: bb127]; ++ goto -> bb14; } -- bb149: { +- bb141: { - _108 = move _2; -- _107 = std::future::get_context::<'_, '_>(move _108) -> [return: bb148, unwind: bb135]; -+ bb149 (cleanup): { +- _107 = std::future::get_context::<'_, '_>(move _108) -> [return: bb140, unwind: bb127]; ++ bb141 (cleanup): { + discriminant((*_182)) = 2; + resume; } - bb150: { + bb142: { - _109 = &mut _95; -- _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb149, unwind: bb135]; +- _106 = Pin::<&mut impl Future>::new_unchecked(move _109) -> [return: bb141, unwind: bb127]; + StorageLive(_17); + StorageLive(_23); + StorageLive(_25); + StorageLive(_28); + _28 = move _183; -+ goto -> bb42; ++ goto -> bb34; } - bb151: { + bb143: { - StorageLive(_95); -- _95 = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb150, unwind: bb135]; +- _95 = async_drop_in_place::(copy (_110.0: &mut AsyncEnum)) -> [return: bb142, unwind: bb127]; + StorageLive(_17); + StorageLive(_23); + StorageLive(_25); + StorageLive(_35); + _35 = move _183; -+ goto -> bb44; ++ goto -> bb36; } - bb152: { + bb144: { - _111 = &mut _15; -- _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb151, unwind: bb45]; +- _110 = Pin::<&mut AsyncEnum>::new_unchecked(move _111) -> [return: bb143, unwind: bb37]; + StorageLive(_17); + StorageLive(_23); + StorageLive(_45); + _45 = move _183; -+ goto -> bb55; ++ goto -> bb47; } - bb153: { + bb145: { - StorageDead(_112); -- goto -> bb17; +- goto -> bb9; + StorageLive(_17); + StorageLive(_23); + StorageLive(_52); + _52 = move _183; -+ goto -> bb56; ++ goto -> bb48; } - bb154: { + bb146: { - StorageDead(_112); -- goto -> bb30; +- goto -> bb22; + StorageLive(_17); + StorageLive(_62); + _62 = move _183; -+ goto -> bb67; ++ goto -> bb59; } -- bb155 (cleanup): { +- bb147 (cleanup): { - StorageDead(_112); -- goto -> bb46; -+ bb155: { +- goto -> bb38; ++ bb147: { + StorageLive(_17); + StorageLive(_69); + _69 = move _183; -+ goto -> bb68; ++ goto -> bb60; } - bb156: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb156, unwind: bb155]; + bb148: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb148, unwind: bb147]; + StorageLive(_17); + StorageLive(_79); + _79 = move _183; -+ goto -> bb79; ++ goto -> bb71; } - bb157: { + bb149: { - _2 = move _113; - StorageDead(_113); -- goto -> bb156; +- goto -> bb148; + StorageLive(_17); + StorageLive(_86); + _86 = move _183; -+ goto -> bb80; ++ goto -> bb72; } - bb158: { + bb150: { - _2 = move _113; - StorageDead(_113); -- goto -> bb163; +- goto -> bb155; + StorageLive(_96); + _96 = move _183; -+ goto -> bb91; ++ goto -> bb83; } - bb159: { + bb151: { - StorageLive(_113); -- _113 = yield(const ()) -> [resume: bb157, drop: bb158]; +- _113 = yield(const ()) -> [resume: bb149, drop: bb150]; + StorageLive(_103); + _103 = move _183; -+ goto -> bb92; ++ goto -> bb84; } - bb160: { + bb152: { - _115 = discriminant(_114); -- switchInt(move _115) -> [0: bb154, 1: bb159, otherwise: bb59]; +- switchInt(move _115) -> [0: bb146, 1: bb151, otherwise: bb51]; + StorageLive(_113); + _113 = move _183; -+ goto -> bb103; ++ goto -> bb95; } - bb161: { -- _114 = as Future>::poll(move _116, move _117) -> [return: bb160, unwind: bb155]; + bb153: { +- _114 = as Future>::poll(move _116, move _117) -> [return: bb152, unwind: bb147]; + StorageLive(_120); + _120 = move _183; -+ goto -> bb104; ++ goto -> bb96; } - bb162: { + bb154: { - _118 = move _2; -- _117 = std::future::get_context::<'_, '_>(move _118) -> [return: bb161, unwind: bb155]; +- _117 = std::future::get_context::<'_, '_>(move _118) -> [return: bb153, unwind: bb147]; + StorageLive(_130); + _130 = move _183; -+ goto -> bb115; ++ goto -> bb107; } - bb163: { + bb155: { - _119 = &mut _112; -- _116 = Pin::<&mut impl Future>::new_unchecked(move _119) -> [return: bb162, unwind: bb155]; +- _116 = Pin::<&mut impl Future>::new_unchecked(move _119) -> [return: bb154, unwind: bb147]; + StorageLive(_137); + _137 = move _183; -+ goto -> bb116; ++ goto -> bb108; } - bb164: { + bb156: { - _2 = move _120; - StorageDead(_120); -- goto -> bb170; +- goto -> bb162; + StorageLive(_147); + _147 = move _183; -+ goto -> bb127; ++ goto -> bb119; } - bb165: { + bb157: { - _2 = move _120; - StorageDead(_120); -- goto -> bb163; +- goto -> bb155; + StorageLive(_154); + _154 = move _183; -+ goto -> bb128; ++ goto -> bb120; } - bb166: { + bb158: { - StorageLive(_120); -- _120 = yield(const ()) -> [resume: bb164, drop: bb165]; +- _120 = yield(const ()) -> [resume: bb156, drop: bb157]; + StorageLive(_164); + _164 = move _183; -+ goto -> bb139; ++ goto -> bb131; } - bb167: { + bb159: { - _122 = discriminant(_121); -- switchInt(move _122) -> [0: bb153, 1: bb166, otherwise: bb59]; +- switchInt(move _122) -> [0: bb145, 1: bb158, otherwise: bb51]; + StorageLive(_171); + _171 = move _183; -+ goto -> bb140; ++ goto -> bb132; } - bb168: { -- _121 = as Future>::poll(move _123, move _124) -> [return: bb167, unwind: bb155]; -+ assert(const false, "`async fn` resumed after panicking") -> [success: bb168, unwind continue]; + bb160: { +- _121 = as Future>::poll(move _123, move _124) -> [return: bb159, unwind: bb147]; ++ assert(const false, "`async fn` resumed after panicking") -> [success: bb160, unwind continue]; } - bb169: { + bb161: { - _125 = move _2; -- _124 = std::future::get_context::<'_, '_>(move _125) -> [return: bb168, unwind: bb155]; -+ assert(const false, "`async fn` resumed after completion") -> [success: bb169, unwind continue]; +- _124 = std::future::get_context::<'_, '_>(move _125) -> [return: bb160, unwind: bb147]; ++ assert(const false, "`async fn` resumed after completion") -> [success: bb161, unwind continue]; } - bb170: { + bb162: { - _126 = &mut _112; -- _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb169, unwind: bb155]; +- _123 = Pin::<&mut impl Future>::new_unchecked(move _126) -> [return: bb161, unwind: bb147]; - } - -- bb171: { +- bb163: { - StorageLive(_112); -- _112 = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb170, unwind: bb155]; +- _112 = async_drop_in_place::(copy (_127.0: &mut SyncThenAsync)) -> [return: bb162, unwind: bb147]; - } - -- bb172: { +- bb164: { - _128 = &mut _11; -- _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb171, unwind: bb46]; +- _127 = Pin::<&mut SyncThenAsync>::new_unchecked(move _128) -> [return: bb163, unwind: bb38]; - } - -- bb173: { +- bb165: { - StorageDead(_129); -- goto -> bb18; +- goto -> bb10; - } - -- bb174: { +- bb166: { - StorageDead(_129); -- goto -> bb31; +- goto -> bb23; - } - -- bb175 (cleanup): { +- bb167 (cleanup): { - StorageDead(_129); -- goto -> bb47; +- goto -> bb39; - } - -- bb176: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb176, unwind: bb175]; +- bb168: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb168, unwind: bb167]; - } - -- bb177: { +- bb169: { - _2 = move _130; - StorageDead(_130); -- goto -> bb176; +- goto -> bb168; - } - -- bb178: { +- bb170: { - _2 = move _130; - StorageDead(_130); -- goto -> bb183; +- goto -> bb175; - } - -- bb179: { +- bb171: { - StorageLive(_130); -- _130 = yield(const ()) -> [resume: bb177, drop: bb178]; +- _130 = yield(const ()) -> [resume: bb169, drop: bb170]; - } - -- bb180: { +- bb172: { - _132 = discriminant(_131); -- switchInt(move _132) -> [0: bb174, 1: bb179, otherwise: bb59]; +- switchInt(move _132) -> [0: bb166, 1: bb171, otherwise: bb51]; - } - -- bb181: { -- _131 = as Future>::poll(move _133, move _134) -> [return: bb180, unwind: bb175]; +- bb173: { +- _131 = as Future>::poll(move _133, move _134) -> [return: bb172, unwind: bb167]; - } - -- bb182: { +- bb174: { - _135 = move _2; -- _134 = std::future::get_context::<'_, '_>(move _135) -> [return: bb181, unwind: bb175]; +- _134 = std::future::get_context::<'_, '_>(move _135) -> [return: bb173, unwind: bb167]; - } - -- bb183: { +- bb175: { - _136 = &mut _129; -- _133 = Pin::<&mut impl Future>::new_unchecked(move _136) -> [return: bb182, unwind: bb175]; +- _133 = Pin::<&mut impl Future>::new_unchecked(move _136) -> [return: bb174, unwind: bb167]; - } - -- bb184: { +- bb176: { - _2 = move _137; - StorageDead(_137); -- goto -> bb190; +- goto -> bb182; - } - -- bb185: { +- bb177: { - _2 = move _137; - StorageDead(_137); -- goto -> bb183; +- goto -> bb175; - } - -- bb186: { +- bb178: { - StorageLive(_137); -- _137 = yield(const ()) -> [resume: bb184, drop: bb185]; +- _137 = yield(const ()) -> [resume: bb176, drop: bb177]; - } - -- bb187: { +- bb179: { - _139 = discriminant(_138); -- switchInt(move _139) -> [0: bb173, 1: bb186, otherwise: bb59]; +- switchInt(move _139) -> [0: bb165, 1: bb178, otherwise: bb51]; - } - -- bb188: { -- _138 = as Future>::poll(move _140, move _141) -> [return: bb187, unwind: bb175]; +- bb180: { +- _138 = as Future>::poll(move _140, move _141) -> [return: bb179, unwind: bb167]; - } - -- bb189: { +- bb181: { - _142 = move _2; -- _141 = std::future::get_context::<'_, '_>(move _142) -> [return: bb188, unwind: bb175]; +- _141 = std::future::get_context::<'_, '_>(move _142) -> [return: bb180, unwind: bb167]; - } - -- bb190: { +- bb182: { - _143 = &mut _129; -- _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb189, unwind: bb175]; +- _140 = Pin::<&mut impl Future>::new_unchecked(move _143) -> [return: bb181, unwind: bb167]; - } - -- bb191: { +- bb183: { - StorageLive(_129); -- _129 = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb190, unwind: bb175]; +- _129 = async_drop_in_place::(copy (_144.0: &mut AsyncStruct)) -> [return: bb182, unwind: bb167]; - } - -- bb192: { +- bb184: { - _145 = &mut _8; -- _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb191, unwind: bb47]; +- _144 = Pin::<&mut AsyncStruct>::new_unchecked(move _145) -> [return: bb183, unwind: bb39]; - } - -- bb193: { +- bb185: { - StorageDead(_146); -- goto -> bb19; +- goto -> bb11; - } - -- bb194: { +- bb186: { - StorageDead(_146); -- goto -> bb32; +- goto -> bb24; - } - -- bb195 (cleanup): { +- bb187 (cleanup): { - StorageDead(_146); -- goto -> bb48; +- goto -> bb40; - } - -- bb196: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb196, unwind: bb195]; +- bb188: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb188, unwind: bb187]; - } - -- bb197: { +- bb189: { - _2 = move _147; - StorageDead(_147); -- goto -> bb196; +- goto -> bb188; - } - -- bb198: { +- bb190: { - _2 = move _147; - StorageDead(_147); -- goto -> bb203; +- goto -> bb195; - } - -- bb199: { +- bb191: { - StorageLive(_147); -- _147 = yield(const ()) -> [resume: bb197, drop: bb198]; +- _147 = yield(const ()) -> [resume: bb189, drop: bb190]; - } - -- bb200: { +- bb192: { - _149 = discriminant(_148); -- switchInt(move _149) -> [0: bb194, 1: bb199, otherwise: bb59]; +- switchInt(move _149) -> [0: bb186, 1: bb191, otherwise: bb51]; - } - -- bb201: { -- _148 = as Future>::poll(move _150, move _151) -> [return: bb200, unwind: bb195]; +- bb193: { +- _148 = as Future>::poll(move _150, move _151) -> [return: bb192, unwind: bb187]; - } - -- bb202: { +- bb194: { - _152 = move _2; -- _151 = std::future::get_context::<'_, '_>(move _152) -> [return: bb201, unwind: bb195]; +- _151 = std::future::get_context::<'_, '_>(move _152) -> [return: bb193, unwind: bb187]; - } - -- bb203: { +- bb195: { - _153 = &mut _146; -- _150 = Pin::<&mut impl Future>::new_unchecked(move _153) -> [return: bb202, unwind: bb195]; +- _150 = Pin::<&mut impl Future>::new_unchecked(move _153) -> [return: bb194, unwind: bb187]; - } - -- bb204: { +- bb196: { - _2 = move _154; - StorageDead(_154); -- goto -> bb210; +- goto -> bb202; - } - -- bb205: { +- bb197: { - _2 = move _154; - StorageDead(_154); -- goto -> bb203; +- goto -> bb195; - } - -- bb206: { +- bb198: { - StorageLive(_154); -- _154 = yield(const ()) -> [resume: bb204, drop: bb205]; +- _154 = yield(const ()) -> [resume: bb196, drop: bb197]; - } - -- bb207: { +- bb199: { - _156 = discriminant(_155); -- switchInt(move _156) -> [0: bb193, 1: bb206, otherwise: bb59]; +- switchInt(move _156) -> [0: bb185, 1: bb198, otherwise: bb51]; - } - -- bb208: { -- _155 = as Future>::poll(move _157, move _158) -> [return: bb207, unwind: bb195]; +- bb200: { +- _155 = as Future>::poll(move _157, move _158) -> [return: bb199, unwind: bb187]; - } - -- bb209: { +- bb201: { - _159 = move _2; -- _158 = std::future::get_context::<'_, '_>(move _159) -> [return: bb208, unwind: bb195]; +- _158 = std::future::get_context::<'_, '_>(move _159) -> [return: bb200, unwind: bb187]; - } - -- bb210: { +- bb202: { - _160 = &mut _146; -- _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb209, unwind: bb195]; +- _157 = Pin::<&mut impl Future>::new_unchecked(move _160) -> [return: bb201, unwind: bb187]; - } - -- bb211: { +- bb203: { - StorageLive(_146); -- _146 = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb210, unwind: bb195]; +- _146 = async_drop_in_place::<[AsyncInt; 2]>(copy (_161.0: &mut [AsyncInt; 2])) -> [return: bb202, unwind: bb187]; - } - -- bb212: { +- bb204: { - _162 = &mut _5; -- _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb211, unwind: bb48]; +- _161 = Pin::<&mut [AsyncInt; 2]>::new_unchecked(move _162) -> [return: bb203, unwind: bb40]; - } - -- bb213: { +- bb205: { - StorageDead(_163); -- goto -> bb20; +- goto -> bb12; - } - -- bb214: { +- bb206: { - StorageDead(_163); -- goto -> bb33; +- goto -> bb25; - } - -- bb215 (cleanup): { +- bb207 (cleanup): { - StorageDead(_163); -- goto -> bb49; +- goto -> bb41; - } - -- bb216: { -- assert(const false, "`async fn` resumed after async drop") -> [success: bb216, unwind: bb215]; +- bb208: { +- assert(const false, "`async fn` resumed after async drop") -> [success: bb208, unwind: bb207]; - } - -- bb217: { +- bb209: { - _2 = move _164; - StorageDead(_164); -- goto -> bb216; +- goto -> bb208; - } - -- bb218: { +- bb210: { - _2 = move _164; - StorageDead(_164); -- goto -> bb223; +- goto -> bb215; - } - -- bb219: { +- bb211: { - StorageLive(_164); -- _164 = yield(const ()) -> [resume: bb217, drop: bb218]; +- _164 = yield(const ()) -> [resume: bb209, drop: bb210]; - } - -- bb220: { +- bb212: { - _166 = discriminant(_165); -- switchInt(move _166) -> [0: bb214, 1: bb219, otherwise: bb59]; +- switchInt(move _166) -> [0: bb206, 1: bb211, otherwise: bb51]; - } - -- bb221: { -- _165 = as Future>::poll(move _167, move _168) -> [return: bb220, unwind: bb215]; +- bb213: { +- _165 = as Future>::poll(move _167, move _168) -> [return: bb212, unwind: bb207]; - } - -- bb222: { +- bb214: { - _169 = move _2; -- _168 = std::future::get_context::<'_, '_>(move _169) -> [return: bb221, unwind: bb215]; +- _168 = std::future::get_context::<'_, '_>(move _169) -> [return: bb213, unwind: bb207]; - } - -- bb223: { +- bb215: { - _170 = &mut _163; -- _167 = Pin::<&mut impl Future>::new_unchecked(move _170) -> [return: bb222, unwind: bb215]; +- _167 = Pin::<&mut impl Future>::new_unchecked(move _170) -> [return: bb214, unwind: bb207]; - } - -- bb224: { +- bb216: { - _2 = move _171; - StorageDead(_171); -- goto -> bb230; +- goto -> bb222; - } - -- bb225: { +- bb217: { - _2 = move _171; - StorageDead(_171); -- goto -> bb223; +- goto -> bb215; - } - -- bb226: { +- bb218: { - StorageLive(_171); -- _171 = yield(const ()) -> [resume: bb224, drop: bb225]; +- _171 = yield(const ()) -> [resume: bb216, drop: bb217]; - } - -- bb227: { +- bb219: { - _173 = discriminant(_172); -- switchInt(move _173) -> [0: bb213, 1: bb226, otherwise: bb59]; +- switchInt(move _173) -> [0: bb205, 1: bb218, otherwise: bb51]; - } - -- bb228: { -- _172 = as Future>::poll(move _174, move _175) -> [return: bb227, unwind: bb215]; +- bb220: { +- _172 = as Future>::poll(move _174, move _175) -> [return: bb219, unwind: bb207]; - } - -- bb229: { +- bb221: { - _176 = move _2; -- _175 = std::future::get_context::<'_, '_>(move _176) -> [return: bb228, unwind: bb215]; +- _175 = std::future::get_context::<'_, '_>(move _176) -> [return: bb220, unwind: bb207]; - } - -- bb230: { +- bb222: { - _177 = &mut _163; -- _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb229, unwind: bb215]; +- _174 = Pin::<&mut impl Future>::new_unchecked(move _177) -> [return: bb221, unwind: bb207]; - } - -- bb231: { +- bb223: { - StorageLive(_163); -- _163 = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb230, unwind: bb215]; +- _163 = async_drop_in_place::(copy (_178.0: &mut AsyncInt)) -> [return: bb222, unwind: bb207]; - } - -- bb232: { +- bb224: { - _179 = &mut _4; -- _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb231, unwind: bb49]; +- _178 = Pin::<&mut AsyncInt>::new_unchecked(move _179) -> [return: bb223, unwind: bb41]; + nop; + (((*_182) as variant#20).1: SyncInt) = SyncInt(const 0_i32); + nop; @@ -1967,7 +1928,36 @@ + StorageLive(_7); + _7 = AsyncInt(const 2_i32); + (((*_182) as variant#18).3: [AsyncInt; 2]) = [move _6, move _7]; -+ goto -> bb1; ++ StorageDead(_7); ++ StorageDead(_6); ++ nop; ++ StorageLive(_9); ++ _9 = AsyncInt(const 5_i32); ++ StorageLive(_10); ++ _10 = AsyncInt(const 4_i32); ++ (((*_182) as variant#16).4: AsyncStruct) = AsyncStruct { i: const 3_i32, a: move _10, b: move _9 }; ++ StorageDead(_10); ++ StorageDead(_9); ++ nop; ++ StorageLive(_12); ++ _12 = AsyncInt(const 7_i32); ++ StorageLive(_13); ++ _13 = SyncInt(const 8_i32); ++ StorageLive(_14); ++ _14 = AsyncInt(const 9_i32); ++ (((*_182) as variant#14).5: SyncThenAsync) = SyncThenAsync { i: const 6_i32, a: move _12, b: move _13, c: move _14 }; ++ StorageDead(_14); ++ StorageDead(_13); ++ StorageDead(_12); ++ nop; ++ StorageLive(_16); ++ _16 = AsyncInt(const 10_i32); ++ (((*_182) as variant#12).6: AsyncEnum) = AsyncEnum::A(move _16); ++ StorageDead(_16); ++ StorageLive(_17); ++ StorageLive(_18); ++ _18 = AsyncInt(const 11_i32); ++ _17 = ManuallyDrop::::new(move _18) -> [return: bb1, unwind: bb21]; } } diff --git a/tests/mir-opt/coroutine/coroutine.main-{closure#0}.StateTransform.diff b/tests/mir-opt/coroutine/coroutine.main-{closure#0}.StateTransform.diff index 17671228295e3..ad15ac5668c2e 100644 --- a/tests/mir-opt/coroutine/coroutine.main-{closure#0}.StateTransform.diff +++ b/tests/mir-opt/coroutine/coroutine.main-{closure#0}.StateTransform.diff @@ -44,28 +44,24 @@ - StorageLive(_5); - StorageLive(_6); - _6 = &_2; -- _5 = ::clone(move _6) -> [return: bb1, unwind: bb31]; +- _5 = ::clone(move _6) -> [return: bb1, unwind: bb26]; + _18 = copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:19:5: 19:18}); + _17 = discriminant((*_18)); -+ switchInt(move _17) -> [0: bb36, 1: bb34, 2: bb33, 3: bb31, 4: bb32, otherwise: bb35]; ++ switchInt(move _17) -> [0: bb30, 1: bb28, 2: bb27, 3: bb25, 4: bb26, otherwise: bb29]; } bb1: { StorageDead(_6); StorageLive(_7); -- _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb30]; -+ _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb21]; +- _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb25]; ++ _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb16]; } bb2: { _4 = (const "first", move _5, move _7); StorageDead(_7); - goto -> bb3; - } - - bb3: { StorageDead(_5); -- _3 = yield(move _4) -> [resume: bb4, drop: bb18]; +- _3 = yield(move _4) -> [resume: bb3, drop: bb14]; + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _4); + StorageDead(_3); + StorageDead(_4); @@ -73,17 +69,13 @@ + return; } - bb4: { - goto -> bb5; - } - - bb5: { + bb3: { StorageDead(_4); -- drop(_3) -> [return: bb6, unwind: bb34]; -+ drop(_3) -> [return: bb6, unwind: bb25]; +- drop(_3) -> [return: bb4, unwind: bb28]; ++ drop(_3) -> [return: bb4, unwind: bb19]; } - bb6: { + bb4: { StorageDead(_3); StorageLive(_8); StorageLive(_9); @@ -94,30 +86,26 @@ StorageLive(_12); StorageLive(_13); - _13 = &_2; -- _12 = ::clone(move _13) -> [return: bb7, unwind: bb28]; +- _12 = ::clone(move _13) -> [return: bb5, unwind: bb23]; + _13 = &(((*_18) as variant#4).0: std::string::String); -+ _12 = ::clone(move _13) -> [return: bb7, unwind: bb19]; ++ _12 = ::clone(move _13) -> [return: bb5, unwind: bb14]; } - bb7: { + bb5: { StorageDead(_13); StorageLive(_14); StorageLive(_15); -- _15 = Location::<'_>::caller() -> [return: bb8, unwind: bb24]; -+ _15 = Location::<'_>::caller() -> [return: bb8, unwind: bb15]; +- _15 = Location::<'_>::caller() -> [return: bb6, unwind: bb20]; ++ _15 = Location::<'_>::caller() -> [return: bb6, unwind: bb11]; } - bb8: { + bb6: { _14 = &(*_15); _9 = (move _10, move _12, move _14); StorageDead(_14); - goto -> bb9; - } - - bb9: { StorageDead(_12); StorageDead(_10); -- _8 = yield(move _9) -> [resume: bb10, drop: bb15]; +- _8 = yield(move _9) -> [resume: bb7, drop: bb11]; + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _9); + StorageDead(_8); + StorageDead(_9); @@ -127,219 +115,202 @@ + return; } - bb10: { - goto -> bb11; - } - - bb11: { + bb7: { StorageDead(_9); -- drop(_8) -> [return: bb12, unwind: bb27]; -+ drop(_8) -> [return: bb12, unwind: bb18]; +- drop(_8) -> [return: bb8, unwind: bb22]; ++ drop(_8) -> [return: bb8, unwind: bb13]; } - bb12: { + bb8: { StorageDead(_15); StorageDead(_11); StorageDead(_8); - _0 = const (); -- drop(_2) -> [return: bb13, unwind: bb36]; +- drop(_2) -> [return: bb9, unwind: bb30]; + _16 = const (); -+ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb13, unwind: bb27]; ++ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb9, unwind: bb21]; } - bb13: { -- drop(_1) -> [return: bb14, unwind: bb37]; -+ goto -> bb29; + bb9: { +- drop(_1) -> [return: bb10, unwind: bb31]; ++ goto -> bb23; } - bb14: { + bb10: { + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Complete(move _16); + discriminant((*_18)) = 1; return; } -- bb15: { -- goto -> bb16; -+ bb15 (cleanup): { +- bb11: { +- goto -> bb12; ++ bb11 (cleanup): { + StorageDead(_14); -+ drop(_12) -> [return: bb16, unwind terminate(cleanup)]; ++ drop(_12) -> [return: bb12, unwind terminate(cleanup)]; } -- bb16: { -- StorageDead(_9); -+ bb16 (cleanup): { +- bb12: { ++ bb12 (cleanup): { + StorageDead(_12); + StorageDead(_10); - goto -> bb17; + StorageDead(_9); + goto -> bb13; } -- bb17: { -- StorageDead(_15); +- bb13: { ++ bb13 (cleanup): { + StorageDead(_15); - StorageDead(_11); - StorageDead(_8); -- goto -> bb21; -+ bb17 (cleanup): { -+ StorageDead(_9); -+ goto -> bb18; +- goto -> bb17; ++ goto -> bb15; } -- bb18: { -- goto -> bb19; -+ bb18 (cleanup): { -+ StorageDead(_15); -+ goto -> bb20; - } - -- bb19: { -- StorageDead(_4); -+ bb19 (cleanup): { +- bb14: { ++ bb14 (cleanup): { + StorageDead(_13); + StorageDead(_12); + StorageDead(_10); + StorageDead(_9); - goto -> bb20; + goto -> bb15; } -- bb20: { -- StorageDead(_3); -- goto -> bb21; -+ bb20 (cleanup): { +- bb15: { +- StorageDead(_4); +- goto -> bb16; ++ bb15 (cleanup): { + StorageDead(_11); + StorageDead(_8); -+ goto -> bb26; ++ goto -> bb20; } -- bb21: { -- drop(_2) -> [return: bb22, unwind: bb38]; -+ bb21 (cleanup): { +- bb16: { +- StorageDead(_3); +- goto -> bb17; ++ bb16 (cleanup): { + StorageDead(_7); -+ drop(_5) -> [return: bb23, unwind terminate(cleanup)]; ++ drop(_5) -> [return: bb18, unwind terminate(cleanup)]; } -- bb22: { -- drop(_1) -> [return: bb23, unwind: bb37]; -+ bb22 (cleanup): { +- bb17: { +- drop(_2) -> [return: bb18, unwind: bb32]; ++ bb17 (cleanup): { + StorageDead(_6); -+ goto -> bb23; ++ goto -> bb18; } -- bb23: { -- coroutine_drop; -+ bb23 (cleanup): { +- bb18: { +- drop(_1) -> [return: bb19, unwind: bb31]; ++ bb18 (cleanup): { + StorageDead(_5); -+ goto -> bb24; ++ StorageDead(_4); ++ goto -> bb19; } - bb24 (cleanup): { +- bb19: { +- coroutine_drop; ++ bb19 (cleanup): { ++ StorageDead(_3); ++ goto -> bb20; + } + + bb20 (cleanup): { - StorageDead(_14); -- drop(_12) -> [return: bb25, unwind terminate(cleanup)]; -+ StorageDead(_4); -+ goto -> bb25; +- drop(_12) -> [return: bb21, unwind terminate(cleanup)]; ++ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb21, unwind terminate(cleanup)]; } - bb25 (cleanup): { + bb21 (cleanup): { - StorageDead(_12); - StorageDead(_10); -+ StorageDead(_3); - goto -> bb26; - } - - bb26 (cleanup): { - StorageDead(_9); -- goto -> bb27; -+ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb27, unwind terminate(cleanup)]; + goto -> bb22; } - bb27 (cleanup): { + bb22 (cleanup): { - StorageDead(_15); -- goto -> bb29; -+ goto -> bb28; + goto -> bb24; } - bb28 (cleanup): { +- bb23 (cleanup): { - StorageDead(_13); - StorageDead(_12); - StorageDead(_10); - StorageDead(_9); -- goto -> bb29; -+ goto -> bb30; +- goto -> bb24; ++ bb23: { ++ goto -> bb10; } -- bb29 (cleanup): { + bb24 (cleanup): { - StorageDead(_11); - StorageDead(_8); -- goto -> bb35; -+ bb29: { -+ goto -> bb14; - } - - bb30 (cleanup): { -- StorageDead(_7); -- drop(_5) -> [return: bb32, unwind terminate(cleanup)]; +- goto -> bb29; + discriminant((*_18)) = 2; + resume; } -- bb31 (cleanup): { -- StorageDead(_6); -- goto -> bb32; -+ bb31: { +- bb25 (cleanup): { +- StorageDead(_7); +- drop(_5) -> [return: bb27, unwind terminate(cleanup)]; ++ bb25: { + StorageLive(_3); + StorageLive(_4); + _3 = move _2; -+ goto -> bb4; ++ goto -> bb3; } -- bb32 (cleanup): { -- StorageDead(_5); -- goto -> bb33; -+ bb32: { +- bb26 (cleanup): { +- StorageDead(_6); +- goto -> bb27; ++ bb26: { + StorageLive(_8); + StorageLive(_9); + StorageLive(_11); + StorageLive(_15); + _8 = move _2; -+ goto -> bb10; ++ goto -> bb7; } -- bb33 (cleanup): { +- bb27 (cleanup): { +- StorageDead(_5); - StorageDead(_4); -- goto -> bb34; -+ bb33: { -+ assert(const false, "coroutine resumed after panicking") -> [success: bb33, unwind continue]; +- goto -> bb28; ++ bb27: { ++ assert(const false, "coroutine resumed after panicking") -> [success: bb27, unwind continue]; } -- bb34 (cleanup): { +- bb28 (cleanup): { - StorageDead(_3); -- goto -> bb35; -+ bb34: { -+ assert(const false, "coroutine resumed after completion") -> [success: bb34, unwind continue]; +- goto -> bb29; ++ bb28: { ++ assert(const false, "coroutine resumed after completion") -> [success: bb28, unwind continue]; } -- bb35 (cleanup): { -- drop(_2) -> [return: bb36, unwind terminate(cleanup)]; -+ bb35: { +- bb29 (cleanup): { +- drop(_2) -> [return: bb30, unwind terminate(cleanup)]; ++ bb29: { + unreachable; } -- bb36 (cleanup): { -- drop(_1) -> [return: bb37, unwind terminate(cleanup)]; +- bb30 (cleanup): { +- drop(_1) -> [return: bb31, unwind terminate(cleanup)]; - } - -- bb37 (cleanup): { +- bb31 (cleanup): { - resume; - } - -- bb38 (cleanup): { -- drop(_1) -> [return: bb37, unwind terminate(cleanup)]; -+ bb36: { +- bb32 (cleanup): { +- drop(_1) -> [return: bb31, unwind terminate(cleanup)]; ++ bb30: { + (((*_18) as variant#4).0: std::string::String) = move _2; + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _6 = &(((*_18) as variant#4).0: std::string::String); -+ _5 = ::clone(move _6) -> [return: bb1, unwind: bb22]; ++ _5 = ::clone(move _6) -> [return: bb1, unwind: bb17]; } } diff --git a/tests/mir-opt/coroutine/coroutine.main-{closure#1}.StateTransform.diff b/tests/mir-opt/coroutine/coroutine.main-{closure#1}.StateTransform.diff index 97c45da8a18f1..24b8b5f4c9937 100644 --- a/tests/mir-opt/coroutine/coroutine.main-{closure#1}.StateTransform.diff +++ b/tests/mir-opt/coroutine/coroutine.main-{closure#1}.StateTransform.diff @@ -44,28 +44,24 @@ - StorageLive(_5); - StorageLive(_6); - _6 = &_2; -- _5 = ::clone(move _6) -> [return: bb1, unwind: bb31]; +- _5 = ::clone(move _6) -> [return: bb1, unwind: bb26]; + _18 = copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:26:5: 26:18}); + _17 = discriminant((*_18)); -+ switchInt(move _17) -> [0: bb36, 1: bb34, 2: bb33, 3: bb31, 4: bb32, otherwise: bb35]; ++ switchInt(move _17) -> [0: bb30, 1: bb28, 2: bb27, 3: bb25, 4: bb26, otherwise: bb29]; } bb1: { StorageDead(_6); StorageLive(_7); -- _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb30]; -+ _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb21]; +- _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb25]; ++ _7 = Location::<'_>::caller() -> [return: bb2, unwind: bb16]; } bb2: { _4 = (const "first", move _5, move _7); StorageDead(_7); - goto -> bb3; - } - - bb3: { StorageDead(_5); -- _3 = yield(move _4) -> [resume: bb4, drop: bb18]; +- _3 = yield(move _4) -> [resume: bb3, drop: bb14]; + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _4); + StorageDead(_3); + StorageDead(_4); @@ -73,17 +69,13 @@ + return; } - bb4: { - goto -> bb5; - } - - bb5: { + bb3: { StorageDead(_4); -- drop(_3) -> [return: bb6, unwind: bb34]; -+ drop(_3) -> [return: bb6, unwind: bb25]; +- drop(_3) -> [return: bb4, unwind: bb28]; ++ drop(_3) -> [return: bb4, unwind: bb19]; } - bb6: { + bb4: { StorageDead(_3); StorageLive(_8); StorageLive(_9); @@ -94,30 +86,26 @@ StorageLive(_12); StorageLive(_13); - _13 = &_2; -- _12 = ::clone(move _13) -> [return: bb7, unwind: bb28]; +- _12 = ::clone(move _13) -> [return: bb5, unwind: bb23]; + _13 = &(((*_18) as variant#4).0: std::string::String); -+ _12 = ::clone(move _13) -> [return: bb7, unwind: bb19]; ++ _12 = ::clone(move _13) -> [return: bb5, unwind: bb14]; } - bb7: { + bb5: { StorageDead(_13); StorageLive(_14); StorageLive(_15); -- _15 = Location::<'_>::caller() -> [return: bb8, unwind: bb24]; -+ _15 = Location::<'_>::caller() -> [return: bb8, unwind: bb15]; +- _15 = Location::<'_>::caller() -> [return: bb6, unwind: bb20]; ++ _15 = Location::<'_>::caller() -> [return: bb6, unwind: bb11]; } - bb8: { + bb6: { _14 = &(*_15); _9 = (move _10, move _12, move _14); StorageDead(_14); - goto -> bb9; - } - - bb9: { StorageDead(_12); StorageDead(_10); -- _8 = yield(move _9) -> [resume: bb10, drop: bb15]; +- _8 = yield(move _9) -> [resume: bb7, drop: bb11]; + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _9); + StorageDead(_8); + StorageDead(_9); @@ -127,219 +115,202 @@ + return; } - bb10: { - goto -> bb11; - } - - bb11: { + bb7: { StorageDead(_9); -- drop(_8) -> [return: bb12, unwind: bb27]; -+ drop(_8) -> [return: bb12, unwind: bb18]; +- drop(_8) -> [return: bb8, unwind: bb22]; ++ drop(_8) -> [return: bb8, unwind: bb13]; } - bb12: { + bb8: { StorageDead(_15); StorageDead(_11); StorageDead(_8); - _0 = const (); -- drop(_2) -> [return: bb13, unwind: bb36]; +- drop(_2) -> [return: bb9, unwind: bb30]; + _16 = const (); -+ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb13, unwind: bb27]; ++ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb9, unwind: bb21]; } - bb13: { -- drop(_1) -> [return: bb14, unwind: bb37]; -+ goto -> bb29; + bb9: { +- drop(_1) -> [return: bb10, unwind: bb31]; ++ goto -> bb23; } - bb14: { + bb10: { + _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Complete(move _16); + discriminant((*_18)) = 1; return; } -- bb15: { -- goto -> bb16; -+ bb15 (cleanup): { +- bb11: { +- goto -> bb12; ++ bb11 (cleanup): { + StorageDead(_14); -+ drop(_12) -> [return: bb16, unwind terminate(cleanup)]; ++ drop(_12) -> [return: bb12, unwind terminate(cleanup)]; } -- bb16: { -- StorageDead(_9); -+ bb16 (cleanup): { +- bb12: { ++ bb12 (cleanup): { + StorageDead(_12); + StorageDead(_10); - goto -> bb17; + StorageDead(_9); + goto -> bb13; } -- bb17: { -- StorageDead(_15); +- bb13: { ++ bb13 (cleanup): { + StorageDead(_15); - StorageDead(_11); - StorageDead(_8); -- goto -> bb21; -+ bb17 (cleanup): { -+ StorageDead(_9); -+ goto -> bb18; +- goto -> bb17; ++ goto -> bb15; } -- bb18: { -- goto -> bb19; -+ bb18 (cleanup): { -+ StorageDead(_15); -+ goto -> bb20; - } - -- bb19: { -- StorageDead(_4); -+ bb19 (cleanup): { +- bb14: { ++ bb14 (cleanup): { + StorageDead(_13); + StorageDead(_12); + StorageDead(_10); + StorageDead(_9); - goto -> bb20; + goto -> bb15; } -- bb20: { -- StorageDead(_3); -- goto -> bb21; -+ bb20 (cleanup): { +- bb15: { +- StorageDead(_4); +- goto -> bb16; ++ bb15 (cleanup): { + StorageDead(_11); + StorageDead(_8); -+ goto -> bb26; ++ goto -> bb20; } -- bb21: { -- drop(_2) -> [return: bb22, unwind: bb38]; -+ bb21 (cleanup): { +- bb16: { +- StorageDead(_3); +- goto -> bb17; ++ bb16 (cleanup): { + StorageDead(_7); -+ drop(_5) -> [return: bb23, unwind terminate(cleanup)]; ++ drop(_5) -> [return: bb18, unwind terminate(cleanup)]; } -- bb22: { -- drop(_1) -> [return: bb23, unwind: bb37]; -+ bb22 (cleanup): { +- bb17: { +- drop(_2) -> [return: bb18, unwind: bb32]; ++ bb17 (cleanup): { + StorageDead(_6); -+ goto -> bb23; ++ goto -> bb18; } -- bb23: { -- coroutine_drop; -+ bb23 (cleanup): { +- bb18: { +- drop(_1) -> [return: bb19, unwind: bb31]; ++ bb18 (cleanup): { + StorageDead(_5); -+ goto -> bb24; ++ StorageDead(_4); ++ goto -> bb19; } - bb24 (cleanup): { +- bb19: { +- coroutine_drop; ++ bb19 (cleanup): { ++ StorageDead(_3); ++ goto -> bb20; + } + + bb20 (cleanup): { - StorageDead(_14); -- drop(_12) -> [return: bb25, unwind terminate(cleanup)]; -+ StorageDead(_4); -+ goto -> bb25; +- drop(_12) -> [return: bb21, unwind terminate(cleanup)]; ++ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb21, unwind terminate(cleanup)]; } - bb25 (cleanup): { + bb21 (cleanup): { - StorageDead(_12); - StorageDead(_10); -+ StorageDead(_3); - goto -> bb26; - } - - bb26 (cleanup): { - StorageDead(_9); -- goto -> bb27; -+ drop((((*_18) as variant#4).0: std::string::String)) -> [return: bb27, unwind terminate(cleanup)]; + goto -> bb22; } - bb27 (cleanup): { + bb22 (cleanup): { - StorageDead(_15); -- goto -> bb29; -+ goto -> bb28; + goto -> bb24; } - bb28 (cleanup): { +- bb23 (cleanup): { - StorageDead(_13); - StorageDead(_12); - StorageDead(_10); - StorageDead(_9); -- goto -> bb29; -+ goto -> bb30; +- goto -> bb24; ++ bb23: { ++ goto -> bb10; } -- bb29 (cleanup): { + bb24 (cleanup): { - StorageDead(_11); - StorageDead(_8); -- goto -> bb35; -+ bb29: { -+ goto -> bb14; - } - - bb30 (cleanup): { -- StorageDead(_7); -- drop(_5) -> [return: bb32, unwind terminate(cleanup)]; +- goto -> bb29; + discriminant((*_18)) = 2; + resume; } -- bb31 (cleanup): { -- StorageDead(_6); -- goto -> bb32; -+ bb31: { +- bb25 (cleanup): { +- StorageDead(_7); +- drop(_5) -> [return: bb27, unwind terminate(cleanup)]; ++ bb25: { + StorageLive(_3); + StorageLive(_4); + _3 = move _2; -+ goto -> bb4; ++ goto -> bb3; } -- bb32 (cleanup): { -- StorageDead(_5); -- goto -> bb33; -+ bb32: { +- bb26 (cleanup): { +- StorageDead(_6); +- goto -> bb27; ++ bb26: { + StorageLive(_8); + StorageLive(_9); + StorageLive(_11); + StorageLive(_15); + _8 = move _2; -+ goto -> bb10; ++ goto -> bb7; } -- bb33 (cleanup): { +- bb27 (cleanup): { +- StorageDead(_5); - StorageDead(_4); -- goto -> bb34; -+ bb33: { -+ assert(const false, "coroutine resumed after panicking") -> [success: bb33, unwind continue]; +- goto -> bb28; ++ bb27: { ++ assert(const false, "coroutine resumed after panicking") -> [success: bb27, unwind continue]; } -- bb34 (cleanup): { +- bb28 (cleanup): { - StorageDead(_3); -- goto -> bb35; -+ bb34: { -+ assert(const false, "coroutine resumed after completion") -> [success: bb34, unwind continue]; +- goto -> bb29; ++ bb28: { ++ assert(const false, "coroutine resumed after completion") -> [success: bb28, unwind continue]; } -- bb35 (cleanup): { -- drop(_2) -> [return: bb36, unwind terminate(cleanup)]; -+ bb35: { +- bb29 (cleanup): { +- drop(_2) -> [return: bb30, unwind terminate(cleanup)]; ++ bb29: { + unreachable; } -- bb36 (cleanup): { -- drop(_1) -> [return: bb37, unwind terminate(cleanup)]; +- bb30 (cleanup): { +- drop(_1) -> [return: bb31, unwind terminate(cleanup)]; - } - -- bb37 (cleanup): { +- bb31 (cleanup): { - resume; - } - -- bb38 (cleanup): { -- drop(_1) -> [return: bb37, unwind terminate(cleanup)]; -+ bb36: { +- bb32 (cleanup): { +- drop(_1) -> [return: bb31, unwind terminate(cleanup)]; ++ bb30: { + (((*_18) as variant#4).0: std::string::String) = move _2; + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _6 = &(((*_18) as variant#4).0: std::string::String); -+ _5 = ::clone(move _6) -> [return: bb1, unwind: bb22]; ++ _5 = ::clone(move _6) -> [return: bb1, unwind: bb17]; } } diff --git a/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.ElaborateDrops.diff b/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.ElaborateDrops.diff new file mode 100644 index 0000000000000..d81b6c612627e --- /dev/null +++ b/tests/mir-opt/coroutine/unwind_in_vec.build-{closure#0}.ElaborateDrops.diff @@ -0,0 +1,307 @@ +- // MIR for `build::{closure#0}` before ElaborateDrops ++ // MIR for `build::{closure#0}` after ElaborateDrops + + fn build::{closure#0}(_1: {async fn body of build()}, _2: std::future::ResumeTy) -> Vec + yields () + { + debug _task_context => _2; + debug s => (_1.0: u64); + let mut _0: std::vec::Vec; + let _3: u64; + let mut _4: std::boxed::Box>; + let mut _5: std::boxed::Box>; + let mut _6: std::string::String; + let mut _7: &str; + let _8: &str; + let mut _9: std::string::String; + let mut _10: &str; + let _11: &str; + let mut _12: std::string::String; + let mut _13: &str; + let _14: &str; + let mut _15: std::string::String; + let mut _16: &str; + let _17: &str; + let mut _18: std::string::String; + let mut _19: &str; + let _20: &str; + scope 1 { + debug s => _3; + } + + bb0: { + StorageLive(_3); + _3 = copy (_1.0: u64); + StorageLive(_4); + StorageLive(_5); + _5 = Box::<[String; 5]>::new_uninit() -> [return: bb1, unwind: bb38]; + } + + bb1: { + StorageLive(_6); + StorageLive(_7); + StorageLive(_8); + _8 = const "0"; + _7 = &(*_8); + _6 = ::to_string(move _7) -> [return: bb2, unwind: bb35]; + } + + bb2: { + StorageDead(_7); + StorageLive(_9); + StorageLive(_10); + StorageLive(_11); + _11 = const "1"; + _10 = &(*_11); + _9 = ::to_string(move _10) -> [return: bb3, unwind: bb31]; + } + + bb3: { + StorageDead(_10); + StorageLive(_12); + StorageLive(_13); + StorageLive(_14); + _14 = const "2"; + _13 = &(*_14); + _12 = ::to_string(move _13) -> [return: bb4, unwind: bb26]; + } + + bb4: { + StorageDead(_13); + StorageLive(_15); + StorageLive(_16); + StorageLive(_17); + _17 = const "3"; + _16 = &(*_17); + _15 = ::to_string(move _16) -> [return: bb5, unwind: bb20]; + } + + bb5: { + StorageDead(_16); + StorageLive(_18); + StorageLive(_19); + StorageLive(_20); + _20 = const "4"; + _19 = &(*_20); + _18 = ::to_string(move _19) -> [return: bb6, unwind: bb13]; + } + + bb6: { + StorageDead(_19); + ((((*_5).1: std::mem::ManuallyDrop<[std::string::String; 5]>).0: std::mem::MaybeDangling<[std::string::String; 5]>).0: [std::string::String; 5]) = [move _6, move _9, move _12, move _15, move _18]; + StorageDead(_18); + StorageDead(_15); + StorageDead(_12); + StorageDead(_9); + StorageDead(_6); + _4 = move _5; +- drop(_5) -> [return: bb7, unwind: bb11]; ++ goto -> bb7; + } + + bb7: { + StorageDead(_5); + _0 = std::boxed::box_assume_init_into_vec_unsafe::(move _4) -> [return: bb8, unwind: bb12]; + } + + bb8: { + StorageDead(_4); + StorageDead(_20); + StorageDead(_17); + StorageDead(_14); + StorageDead(_11); + StorageDead(_8); + StorageDead(_3); +- drop(_1) -> [return: bb9, drop: bb10, unwind continue]; ++ drop(_1) -> [return: bb9, unwind: bb40]; + } + + bb9: { + return; + } + + bb10: { + coroutine_drop; + } + + bb11 (cleanup): { + StorageDead(_5); + goto -> bb12; + } + + bb12 (cleanup): { +- drop(_4) -> [return: bb19, unwind terminate(cleanup)]; ++ goto -> bb19; + } + + bb13 (cleanup): { + StorageDead(_19); + StorageDead(_18); + drop(_15) -> [return: bb14, unwind terminate(cleanup)]; + } + + bb14 (cleanup): { + StorageDead(_15); + drop(_12) -> [return: bb15, unwind terminate(cleanup)]; + } + + bb15 (cleanup): { + StorageDead(_12); + drop(_9) -> [return: bb16, unwind terminate(cleanup)]; + } + + bb16 (cleanup): { + StorageDead(_9); + drop(_6) -> [return: bb17, unwind terminate(cleanup)]; + } + + bb17 (cleanup): { + StorageDead(_6); + drop(_5) -> [return: bb18, unwind terminate(cleanup)]; + } + + bb18 (cleanup): { + StorageDead(_5); + goto -> bb19; + } + + bb19 (cleanup): { + StorageDead(_4); + StorageDead(_20); + goto -> bb25; + } + + bb20 (cleanup): { + StorageDead(_16); + StorageDead(_15); + drop(_12) -> [return: bb21, unwind terminate(cleanup)]; + } + + bb21 (cleanup): { + StorageDead(_12); + drop(_9) -> [return: bb22, unwind terminate(cleanup)]; + } + + bb22 (cleanup): { + StorageDead(_9); + drop(_6) -> [return: bb23, unwind terminate(cleanup)]; + } + + bb23 (cleanup): { + StorageDead(_6); + drop(_5) -> [return: bb24, unwind terminate(cleanup)]; + } + + bb24 (cleanup): { + StorageDead(_5); + StorageDead(_4); + goto -> bb25; + } + + bb25 (cleanup): { + StorageDead(_17); + goto -> bb30; + } + + bb26 (cleanup): { + StorageDead(_13); + StorageDead(_12); + drop(_9) -> [return: bb27, unwind terminate(cleanup)]; + } + + bb27 (cleanup): { + StorageDead(_9); + drop(_6) -> [return: bb28, unwind terminate(cleanup)]; + } + + bb28 (cleanup): { + StorageDead(_6); + drop(_5) -> [return: bb29, unwind terminate(cleanup)]; + } + + bb29 (cleanup): { + StorageDead(_5); + StorageDead(_4); + goto -> bb30; + } + + bb30 (cleanup): { + StorageDead(_14); + goto -> bb34; + } + + bb31 (cleanup): { + StorageDead(_10); + StorageDead(_9); + drop(_6) -> [return: bb32, unwind terminate(cleanup)]; + } + + bb32 (cleanup): { + StorageDead(_6); + drop(_5) -> [return: bb33, unwind terminate(cleanup)]; + } + + bb33 (cleanup): { + StorageDead(_5); + StorageDead(_4); + goto -> bb34; + } + + bb34 (cleanup): { + StorageDead(_11); + goto -> bb37; + } + + bb35 (cleanup): { + StorageDead(_7); + StorageDead(_6); + drop(_5) -> [return: bb36, unwind terminate(cleanup)]; + } + + bb36 (cleanup): { + StorageDead(_5); + StorageDead(_4); + goto -> bb37; + } + + bb37 (cleanup): { + StorageDead(_8); + goto -> bb39; + } + + bb38 (cleanup): { + StorageDead(_5); + StorageDead(_4); + goto -> bb39; + } + + bb39 (cleanup): { + StorageDead(_3); + drop(_1) -> [return: bb40, unwind terminate(cleanup)]; + } + + bb40 (cleanup): { + resume; + } + } + + ALLOC0 (size: 1, align: 1) { + 34 │ 4 + } + + ALLOC1 (size: 1, align: 1) { + 33 │ 3 + } + + ALLOC2 (size: 1, align: 1) { + 32 │ 2 + } + + ALLOC3 (size: 1, align: 1) { + 31 │ 1 + } + + ALLOC4 (size: 1, align: 1) { + 30 │ 0 + } + diff --git a/tests/mir-opt/coroutine/unwind_in_vec.rs b/tests/mir-opt/coroutine/unwind_in_vec.rs new file mode 100644 index 0000000000000..bd2b2ce7e93a3 --- /dev/null +++ b/tests/mir-opt/coroutine/unwind_in_vec.rs @@ -0,0 +1,10 @@ +// Regression test for #154720 +//@ edition: 2018 +//@ needs-unwind +//@ skip-filecheck + +// EMIT_MIR unwind_in_vec.build-{closure#0}.ElaborateDrops.diff +#[inline(never)] +pub async fn build(s: u64) -> Vec { + vec!["0".to_string(), "1".to_string(), "2".to_string(), "3".to_string(), "4".to_string()] +} diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir index 968334753db40..a418d316ed728 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-abort.mir @@ -28,7 +28,7 @@ fn test() -> Option> { StorageLive(_1); StorageLive(_2); StorageLive(_3); - _3 = Box::<[u32; 1]>::new_uninit() -> [return: bb1, unwind: bb14]; + _3 = Box::<[u32; 1]>::new_uninit() -> [return: bb1, unwind: bb13]; } bb1: { @@ -36,7 +36,7 @@ fn test() -> Option> { StorageLive(_5); StorageLive(_6); _6 = Option::::None; - _5 = as Try>::branch(move _6) -> [return: bb2, unwind: bb13]; + _5 = as Try>::branch(move _6) -> [return: bb2, unwind: bb12]; } bb2: { @@ -66,54 +66,50 @@ fn test() -> Option> { _8 = copy ((_5 as Break).0: std::option::Option); StorageLive(_10); _10 = copy _8; - _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb13]; + _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb12]; } bb6: { StorageDead(_10); StorageDead(_8); StorageDead(_4); - drop(_3) -> [return: bb10, unwind: bb14]; + drop(_3) -> [return: bb9, unwind: bb13]; } bb7: { StorageDead(_3); - _1 = std::boxed::box_assume_init_into_vec_unsafe::(move _2) -> [return: bb8, unwind: bb12]; + _1 = std::boxed::box_assume_init_into_vec_unsafe::(move _2) -> [return: bb8, unwind: bb11]; } bb8: { StorageDead(_2); _0 = Option::>::Some(move _1); - goto -> bb9; - } - - bb9: { StorageDead(_1); StorageDead(_5); - goto -> bb11; + goto -> bb10; } - bb10: { + bb9: { StorageDead(_3); StorageDead(_2); StorageDead(_1); StorageDead(_5); - goto -> bb11; + goto -> bb10; } - bb11: { + bb10: { return; } - bb12 (cleanup): { - goto -> bb14; + bb11 (cleanup): { + goto -> bb13; } - bb13 (cleanup): { - drop(_3) -> [return: bb14, unwind terminate(cleanup)]; + bb12 (cleanup): { + drop(_3) -> [return: bb13, unwind terminate(cleanup)]; } - bb14 (cleanup): { + bb13 (cleanup): { resume; } } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir index 1fc75018c8625..46b6aad6912ac 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir @@ -36,7 +36,7 @@ fn test() -> Option> { StorageLive(_5); StorageLive(_6); _6 = Option::::None; - _5 = as Try>::branch(move _6) -> [return: bb2, unwind: bb13]; + _5 = as Try>::branch(move _6) -> [return: bb2, unwind: bb12]; } bb2: { @@ -66,54 +66,50 @@ fn test() -> Option> { _8 = copy ((_5 as Break).0: std::option::Option); StorageLive(_10); _10 = copy _8; - _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb13]; + _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb12]; } bb6: { StorageDead(_10); StorageDead(_8); StorageDead(_4); - drop(_3) -> [return: bb10, unwind: bb14]; + drop(_3) -> [return: bb9, unwind: bb13]; } bb7: { StorageDead(_3); - _1 = std::boxed::box_assume_init_into_vec_unsafe::(move _2) -> [return: bb8, unwind: bb12]; + _1 = std::boxed::box_assume_init_into_vec_unsafe::(move _2) -> [return: bb8, unwind: bb11]; } bb8: { StorageDead(_2); _0 = Option::>::Some(move _1); - goto -> bb9; - } - - bb9: { StorageDead(_1); StorageDead(_5); - goto -> bb11; + goto -> bb10; } - bb10: { + bb9: { StorageDead(_3); StorageDead(_2); StorageDead(_1); StorageDead(_5); - goto -> bb11; + goto -> bb10; } - bb11: { + bb10: { return; } - bb12 (cleanup): { - goto -> bb14; + bb11 (cleanup): { + goto -> bb13; } - bb13 (cleanup): { - drop(_3) -> [return: bb14, unwind terminate(cleanup)]; + bb12 (cleanup): { + drop(_3) -> [return: bb13, unwind terminate(cleanup)]; } - bb14 (cleanup): { + bb13 (cleanup): { resume; } } diff --git a/tests/mir-opt/otherwise_drops.result_ok.ElaborateDrops.diff b/tests/mir-opt/otherwise_drops.result_ok.ElaborateDrops.diff index c9f2f8438990c..aace2787a0796 100644 --- a/tests/mir-opt/otherwise_drops.result_ok.ElaborateDrops.diff +++ b/tests/mir-opt/otherwise_drops.result_ok.ElaborateDrops.diff @@ -22,7 +22,7 @@ bb1: { _0 = Option::::None; - goto -> bb5; + goto -> bb4; } bb2: { @@ -31,46 +31,36 @@ StorageLive(_4); _4 = move _3; _0 = Option::::Some(move _4); -- drop(_4) -> [return: bb3, unwind: bb7]; + StorageDead(_4); +- drop(_3) -> [return: bb3, unwind: bb6]; + goto -> bb3; } bb3: { - StorageDead(_4); -- drop(_3) -> [return: bb4, unwind: bb8]; -+ goto -> bb4; + StorageDead(_3); + goto -> bb4; } bb4: { - StorageDead(_3); - goto -> bb5; +- drop(_1) -> [return: bb5, unwind: bb7]; ++ goto -> bb8; } bb5: { -- drop(_1) -> [return: bb6, unwind: bb9]; -+ goto -> bb10; - } - - bb6: { return; } - bb7 (cleanup): { -- drop(_3) -> [return: bb8, unwind terminate(cleanup)]; -+ goto -> bb8; - } - - bb8 (cleanup): { -- drop(_1) -> [return: bb9, unwind terminate(cleanup)]; -+ goto -> bb9; + bb6 (cleanup): { +- drop(_1) -> [return: bb7, unwind terminate(cleanup)]; ++ goto -> bb7; } - bb9 (cleanup): { + bb7 (cleanup): { resume; + } + -+ bb10: { -+ goto -> bb6; ++ bb8: { ++ goto -> bb5; } } diff --git a/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff index bc38a219ef3c5..8e549bc21884a 100644 --- a/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff @@ -23,22 +23,22 @@ StorageDead(_4); StorageDead(_3); _1 = move (_2.1: Tag); - drop(_1) -> [return: bb1, unwind unreachable]; + drop(_1) -> [return: bb3, unwind unreachable]; } bb1: { - drop((_2.0: Tag)) -> [return: bb3, unwind unreachable]; - } - - bb2: { StorageDead(_2); StorageDead(_1); _0 = const (); return; } + bb2: { + drop((_2.2: Tag)) -> [return: bb1, unwind unreachable]; + } + bb3: { - drop((_2.2: Tag)) -> [return: bb2, unwind unreachable]; + drop((_2.0: Tag)) -> [return: bb2, unwind unreachable]; } } diff --git a/tests/ui/borrowck/match-moved-temporary.rs b/tests/ui/borrowck/match-moved-temporary.rs new file mode 100644 index 0000000000000..41730b374d01f --- /dev/null +++ b/tests/ui/borrowck/match-moved-temporary.rs @@ -0,0 +1,34 @@ +//! Regression test for issue #156713. In the `fails` case, borrowck was trying to check liveness +//! of `bar` which had been moved to a match scrutinee. +//@ edition: 2015 +//@ check-pass + +struct Foo; +impl Drop for Foo { + fn drop(&mut self) {} +} + +struct Bar<'a>(&'a Foo); +impl Drop for Bar<'_> { + fn drop(&mut self) {} +} + +// This compiles +fn works() { + let foo = Foo; + let bar = Bar(&foo); + drop(match { (bar,) } { + args => args, + }) +} + +// This used to error +fn fails() { + let foo = Foo; + let bar = Bar(&foo); + drop(match (bar,) { + args => args, + }) +} + +fn main() {} diff --git a/tests/ui/drop/drop-order-comparisons.e2021.fixed b/tests/ui/drop/drop-order-comparisons.e2021.fixed index 77ebff228e2b4..45be91e54c907 100644 --- a/tests/ui/drop/drop-order-comparisons.e2021.fixed +++ b/tests/ui/drop/drop-order-comparisons.e2021.fixed @@ -102,8 +102,6 @@ fn t_tailexpr_tuples() { (e.ok(2), e.ok(6).is_ok(), e.ok(3), e.ok(5).is_ok()) //[e2021]~^ WARN relative drop order changing in Rust 2024 //[e2021]~| WARN this changes meaning in Rust 2024 - //[e2021]~| WARN relative drop order changing in Rust 2024 - //[e2021]~| WARN this changes meaning in Rust 2024 }, e.mark(1), e.ok(4)); e.assert(6); } diff --git a/tests/ui/drop/drop-order-comparisons.e2021.stderr b/tests/ui/drop/drop-order-comparisons.e2021.stderr index b1f0967103ab5..1a8e557272434 100644 --- a/tests/ui/drop/drop-order-comparisons.e2021.stderr +++ b/tests/ui/drop/drop-order-comparisons.e2021.stderr @@ -27,22 +27,22 @@ LL | | }, e.mark(3), e.ok(4)); | `#1` will be dropped later as of Edition 2024 | note: `#3` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `#1` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `_v` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `#2` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -62,10 +62,12 @@ warning: relative drop order changing in Rust 2024 LL | _ = ({ | _________- LL | | (e.ok(2), e.ok(6).is_ok(), e.ok(3), e.ok(5).is_ok()) - | | ^^^^^^^ - | | | - | | this value will be stored in a temporary; let us call it `#2` - | | up until Edition 2021 `#2` is dropped last but will be dropped earlier in Edition 2024 + | | ------- ^^^^^^^ + | | | | + | | | this value will be stored in a temporary; let us call it `#2` + | | | up until Edition 2021 `#2` is dropped last but will be dropped earlier in Edition 2024 + | | this value will be stored in a temporary; let us call it `#3` + | | up until Edition 2021 `#3` is dropped last but will be dropped earlier in Edition 2024 ... | LL | | }, e.mark(1), e.ok(4)); | | - @@ -75,44 +77,17 @@ LL | | }, e.mark(1), e.ok(4)); | `#1` will be dropped later as of Edition 2024 | note: `#2` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `#1` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 - | -LL | impl<'b> Drop for LogDrop<'b> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages - = warning: this changes meaning in Rust 2024 - = note: for more information, see - -warning: relative drop order changing in Rust 2024 - --> $DIR/drop-order-comparisons.rs:102:19 - | -LL | _ = ({ - | _________- -LL | | (e.ok(2), e.ok(6).is_ok(), e.ok(3), e.ok(5).is_ok()) - | | ^^^^^^^ - | | | - | | this value will be stored in a temporary; let us call it `#2` - | | up until Edition 2021 `#2` is dropped last but will be dropped earlier in Edition 2024 -... | -LL | | }, e.mark(1), e.ok(4)); - | | - - | | | - | | now the temporary value is dropped here, before the local variables in the block or statement - | |__________________________this value will be stored in a temporary; let us call it `#1` - | `#1` will be dropped later as of Edition 2024 - | -note: `#2` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 +note: `#3` invokes this custom destructor + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `#1` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -121,7 +96,7 @@ LL | impl<'b> Drop for LogDrop<'b> { = note: for more information, see warning: relative drop order changing in Rust 2024 - --> $DIR/drop-order-comparisons.rs:223:24 + --> $DIR/drop-order-comparisons.rs:221:24 | LL | _ = ({ | _________- @@ -139,12 +114,12 @@ LL | | }, e.mark(2), e.ok(3)); | `#1` will be dropped later as of Edition 2024 | note: `#2` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `#1` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -153,7 +128,7 @@ LL | impl<'b> Drop for LogDrop<'b> { = note: for more information, see warning: relative drop order changing in Rust 2024 - --> $DIR/drop-order-comparisons.rs:249:24 + --> $DIR/drop-order-comparisons.rs:247:24 | LL | _ = ({ | _________- @@ -171,12 +146,12 @@ LL | | }, e.mark(2), e.ok(3)); | `#1` will be dropped later as of Edition 2024 | note: `#2` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: `#1` invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -185,7 +160,7 @@ LL | impl<'b> Drop for LogDrop<'b> { = note: for more information, see warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:125:13 + --> $DIR/drop-order-comparisons.rs:123:13 | LL | _ = (if let Ok(_) = e.ok(4).as_ref() { | ^^^^^^^^^^^^-------^^^^^^^^^ @@ -193,12 +168,12 @@ LL | _ = (if let Ok(_) = e.ok(4).as_ref() { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:129:5 + --> $DIR/drop-order-comparisons.rs:127:5 | LL | }, e.mark(2), e.ok(3)); | ^ @@ -215,7 +190,7 @@ LL ~ } _ => {}}, e.mark(2), e.ok(3)); | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:147:13 + --> $DIR/drop-order-comparisons.rs:145:13 | LL | _ = (if let Ok(_) = e.err(4).as_ref() {} else { | ^^^^^^^^^^^^--------^^^^^^^^^ @@ -223,12 +198,12 @@ LL | _ = (if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:147:44 + --> $DIR/drop-order-comparisons.rs:145:44 | LL | _ = (if let Ok(_) = e.err(4).as_ref() {} else { | ^ @@ -244,7 +219,7 @@ LL ~ }}, e.mark(2), e.ok(3)); | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:249:12 + --> $DIR/drop-order-comparisons.rs:247:12 | LL | if let Ok(_) = e.err(4).as_ref() {} else { | ^^^^^^^^^^^^--------^^^^^^^^^ @@ -252,12 +227,12 @@ LL | if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:249:43 + --> $DIR/drop-order-comparisons.rs:247:43 | LL | if let Ok(_) = e.err(4).as_ref() {} else { | ^ @@ -273,7 +248,7 @@ LL ~ }} | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:320:12 + --> $DIR/drop-order-comparisons.rs:318:12 | LL | if let true = e.err(9).is_ok() {} else { | ^^^^^^^^^^^--------^^^^^^^^ @@ -281,12 +256,12 @@ LL | if let true = e.err(9).is_ok() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:320:41 + --> $DIR/drop-order-comparisons.rs:318:41 | LL | if let true = e.err(9).is_ok() {} else { | ^ @@ -302,7 +277,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:323:12 + --> $DIR/drop-order-comparisons.rs:321:12 | LL | if let Ok(_v) = e.err(8) {} else { | ^^^^^^^^^^^^^-------- @@ -310,12 +285,12 @@ LL | if let Ok(_v) = e.err(8) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:323:35 + --> $DIR/drop-order-comparisons.rs:321:35 | LL | if let Ok(_v) = e.err(8) {} else { | ^ @@ -331,7 +306,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:326:12 + --> $DIR/drop-order-comparisons.rs:324:12 | LL | if let Ok(_) = e.err(7) {} else { | ^^^^^^^^^^^^-------- @@ -339,12 +314,12 @@ LL | if let Ok(_) = e.err(7) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:326:34 + --> $DIR/drop-order-comparisons.rs:324:34 | LL | if let Ok(_) = e.err(7) {} else { | ^ @@ -360,7 +335,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:329:12 + --> $DIR/drop-order-comparisons.rs:327:12 | LL | if let Ok(_) = e.err(6).as_ref() {} else { | ^^^^^^^^^^^^--------^^^^^^^^^ @@ -368,12 +343,12 @@ LL | if let Ok(_) = e.err(6).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:329:43 + --> $DIR/drop-order-comparisons.rs:327:43 | LL | if let Ok(_) = e.err(6).as_ref() {} else { | ^ @@ -389,7 +364,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:333:12 + --> $DIR/drop-order-comparisons.rs:331:12 | LL | if let Ok(_v) = e.err(5) {} else { | ^^^^^^^^^^^^^-------- @@ -397,12 +372,12 @@ LL | if let Ok(_v) = e.err(5) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:333:35 + --> $DIR/drop-order-comparisons.rs:331:35 | LL | if let Ok(_v) = e.err(5) {} else { | ^ @@ -418,7 +393,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:336:12 + --> $DIR/drop-order-comparisons.rs:334:12 | LL | if let Ok(_) = e.err(4) {} else { | ^^^^^^^^^^^^-------- @@ -426,12 +401,12 @@ LL | if let Ok(_) = e.err(4) {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:336:34 + --> $DIR/drop-order-comparisons.rs:334:34 | LL | if let Ok(_) = e.err(4) {} else { | ^ @@ -447,7 +422,7 @@ LL ~ }}}}}}}}}; | warning: `if let` assigns a shorter lifetime since Edition 2024 - --> $DIR/drop-order-comparisons.rs:372:12 + --> $DIR/drop-order-comparisons.rs:370:12 | LL | if let Ok(_) = e.err(4).as_ref() {} else { | ^^^^^^^^^^^^--------^^^^^^^^^ @@ -455,12 +430,12 @@ LL | if let Ok(_) = e.err(4).as_ref() {} else { | this value has a significant drop implementation which may observe a major change in drop order and requires your discretion | note: value invokes this custom destructor - --> $DIR/drop-order-comparisons.rs:503:1 + --> $DIR/drop-order-comparisons.rs:501:1 | LL | impl<'b> Drop for LogDrop<'b> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: the value is now dropped here in Edition 2024 - --> $DIR/drop-order-comparisons.rs:372:43 + --> $DIR/drop-order-comparisons.rs:370:43 | LL | if let Ok(_) = e.err(4).as_ref() {} else { | ^ @@ -475,5 +450,5 @@ LL | e.mark(3); LL ~ }}}}}}}}}; | -warning: 15 warnings emitted +warning: 14 warnings emitted diff --git a/tests/ui/drop/drop-order-comparisons.rs b/tests/ui/drop/drop-order-comparisons.rs index 7475c48d8161e..45d41b24fba5b 100644 --- a/tests/ui/drop/drop-order-comparisons.rs +++ b/tests/ui/drop/drop-order-comparisons.rs @@ -102,8 +102,6 @@ fn t_tailexpr_tuples() { (e.ok(2), e.ok(6).is_ok(), e.ok(3), e.ok(5).is_ok()) //[e2021]~^ WARN relative drop order changing in Rust 2024 //[e2021]~| WARN this changes meaning in Rust 2024 - //[e2021]~| WARN relative drop order changing in Rust 2024 - //[e2021]~| WARN this changes meaning in Rust 2024 }, e.mark(1), e.ok(4)); e.assert(6); } diff --git a/tests/ui/nll/ice-106874.rs b/tests/ui/nll/ice-106874.rs index 9337eee961bfb..6e8c651e438e5 100644 --- a/tests/ui/nll/ice-106874.rs +++ b/tests/ui/nll/ice-106874.rs @@ -14,8 +14,6 @@ pub fn func(f: F) -> A { //~| ERROR implementation of `FnOnce` is not general enough //~| ERROR implementation of `Fn` is not general enough //~| ERROR implementation of `FnOnce` is not general enough - //~| ERROR higher-ranked subtype error - //~| ERROR higher-ranked subtype error } trait X {} diff --git a/tests/ui/nll/ice-106874.stderr b/tests/ui/nll/ice-106874.stderr index 45dd1557dd027..40728796bdf6d 100644 --- a/tests/ui/nll/ice-106874.stderr +++ b/tests/ui/nll/ice-106874.stderr @@ -25,20 +25,6 @@ help: consider adding an explicit type annotation to the closure's argument LL | A(B(C::new(D::new(move |st: &mut V| f(st))))) | ++++++++ -error: higher-ranked subtype error - --> $DIR/ice-106874.rs:8:5 - | -LL | A(B(C::new(D::new(move |st| f(st))))) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: higher-ranked subtype error - --> $DIR/ice-106874.rs:8:5 - | -LL | A(B(C::new(D::new(move |st| f(st))))) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - error: implementation of `FnOnce` is not general enough --> $DIR/ice-106874.rs:8:7 | @@ -121,5 +107,5 @@ help: consider adding an explicit type annotation to the closure's argument LL | A(B(C::new(D::new(move |st: &mut V| f(st))))) | ++++++++ -error: aborting due to 10 previous errors +error: aborting due to 8 previous errors diff --git a/tests/ui/suggestions/ufcs-for-deref-inner-clone.stderr b/tests/ui/suggestions/ufcs-for-deref-inner-clone.stderr index 7fde14f1a61bb..95af8599458f4 100644 --- a/tests/ui/suggestions/ufcs-for-deref-inner-clone.stderr +++ b/tests/ui/suggestions/ufcs-for-deref-inner-clone.stderr @@ -2,8 +2,12 @@ error[E0507]: cannot move out of dereference of `MyBox>` --> $DIR/ufcs-for-deref-inner-clone.rs:14:14 | LL | let _x = MyBox(vec![1, 2]).into_iter(); - | ^^^^^^^^^^^^^^^^^ move occurs because value has type `Vec`, which does not implement the `Copy` trait + | ^^^^^^^^^^^^^^^^^ ----------- value moved due to this method call + | | + | move occurs because value has type `Vec`, which does not implement the `Copy` trait | +note: `into_iter` takes ownership of the receiver `self`, which moves value + --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL help: you can `clone` the value and consume it, but this might not be your desired behavior | LL | let _x = as Clone>::clone(&MyBox(vec![1, 2])).into_iter();