Skip to content

Commit

Permalink
Fix and bless
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Aug 8, 2024
1 parent dddb7cf commit 9c519d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
14 changes: 4 additions & 10 deletions compiler/rustc_mir_transform/src/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/async-await/field-assign-nonsend.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: 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
|
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/async-await/temp-borrow-nonsend.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-pass
// edition:2021
//@ check-pass
//@ edition:2021

use core::marker::PhantomData;

Expand Down

0 comments on commit 9c519d5

Please sign in to comment.