Skip to content

Commit 9c519d5

Browse files
Fix and bless
1 parent dddb7cf commit 9c519d5

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

compiler/rustc_mir_transform/src/coroutine.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -791,18 +791,13 @@ fn locals_live_across_suspend_points<'tcx>(
791791
.into_results_cursor(body);
792792

793793
let param_env = tcx.param_env(body.source.def_id());
794-
let move_data =
795-
MoveData::gather_moves(body, tcx, param_env).unwrap_or_else(|(move_data, _)| {
796-
tcx.sess.delay_span_bug(body.span, "gather_moves failed");
797-
move_data
798-
});
799-
let mdpe = MoveDataParamEnv { move_data, param_env };
794+
let move_data = MoveData::gather_moves(body, tcx, param_env, |_| true);
800795

801796
// Calculate the set of locals which are initialized
802-
let mut inits = MaybeInitializedPlaces::new(tcx, body, &mdpe)
797+
let mut inits = MaybeInitializedPlaces::new(tcx, body, &move_data)
803798
.into_engine(tcx, body)
804799
.iterate_to_fixpoint()
805-
.into_results_cursor(body_ref);
800+
.into_results_cursor(body);
806801

807802
let mut storage_liveness_map = IndexVec::from_elem(None, &body.basic_blocks);
808803
let mut live_locals_at_suspension_points = Vec::new();
@@ -851,8 +846,7 @@ fn locals_live_across_suspend_points<'tcx>(
851846
let mut init_locals: BitSet<_> = BitSet::new_empty(body.local_decls.len());
852847
if let MaybeReachable::Reachable(bitset) = inits.get() {
853848
for move_path_index in bitset.iter() {
854-
if let Some(local) = mdpe.move_data.move_paths[move_path_index].place.as_local()
855-
{
849+
if let Some(local) = move_data.move_paths[move_path_index].place.as_local() {
856850
init_locals.insert(local);
857851
}
858852
}

tests/ui/async-await/field-assign-nonsend.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
44
LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
7-
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
7+
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
88
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
99
--> $DIR/field-assign-nonsend.rs:16:21
1010
|

tests/ui/async-await/temp-borrow-nonsend.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// check-pass
2-
// edition:2021
1+
//@ check-pass
2+
//@ edition:2021
33

44
use core::marker::PhantomData;
55

0 commit comments

Comments
 (0)