diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs index aa0293ffe3c6e..7c98de90b06af 100644 --- a/compiler/rustc_mir_transform/src/coroutine.rs +++ b/compiler/rustc_mir_transform/src/coroutine.rs @@ -791,18 +791,13 @@ fn locals_live_across_suspend_points<'tcx>( .into_results_cursor(body); let param_env = tcx.param_env(body.source.def_id()); - let move_data = - MoveData::gather_moves(body, tcx, param_env).unwrap_or_else(|(move_data, _)| { - tcx.sess.delay_span_bug(body.span, "gather_moves failed"); - move_data - }); - let mdpe = MoveDataParamEnv { move_data, param_env }; + let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true); // Calculate the set of locals which are initialized - let mut inits = MaybeInitializedPlaces::new(tcx, body, &mdpe) + let mut inits = MaybeInitializedPlaces::new(tcx, body, &move_data) .into_engine(tcx, body) .iterate_to_fixpoint() - .into_results_cursor(body_ref); + .into_results_cursor(body); let mut storage_liveness_map = IndexVec::from_elem(None, &body.basic_blocks); let mut live_locals_at_suspension_points = Vec::new(); @@ -851,8 +846,7 @@ fn locals_live_across_suspend_points<'tcx>( let mut init_locals: BitSet<_> = BitSet::new_empty(body.local_decls.len()); if let MaybeReachable::Reachable(bitset) = inits.get() { for move_path_index in bitset.iter() { - if let Some(local) = mdpe.move_data.move_paths[move_path_index].place.as_local() - { + if let Some(local) = move_data.move_paths[move_path_index].place.as_local() { init_locals.insert(local); } } diff --git a/tests/ui/async-await/field-assign-nonsend.stderr b/tests/ui/async-await/field-assign-nonsend.stderr index 9fec60618b8e2..9960c5fcf67a2 100644 --- a/tests/ui/async-await/field-assign-nonsend.stderr +++ b/tests/ui/async-await/field-assign-nonsend.stderr @@ -4,7 +4,7 @@ error: future cannot be sent between threads safely LL | assert_send(agent.handle()); | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` + = help: within `impl Future`, the trait `Send` is not implemented for `Rc`, which is required by `impl Future: Send` note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send` --> $DIR/field-assign-nonsend.rs:16:21 | diff --git a/tests/ui/async-await/temp-borrow-nonsend.rs b/tests/ui/async-await/temp-borrow-nonsend.rs index 247626a72d5c4..d5f573347fcec 100644 --- a/tests/ui/async-await/temp-borrow-nonsend.rs +++ b/tests/ui/async-await/temp-borrow-nonsend.rs @@ -1,5 +1,5 @@ -// check-pass -// edition:2021 +//@ check-pass +//@ edition:2021 use core::marker::PhantomData;