Skip to content

Commit 029cb1b

Browse files
committedApr 2, 2024
Auto merge of #123372 - GuillaumeGomez:rollup-nwxdzev, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - #122614 (rustdoc-search: shard the search result descriptions) - #123338 (Update to new browser-ui-test version) - #123366 (Minor by_move_body impl cleanups) - #123371 (Remove dangling `.mir.stderr` and `.thir.stderr` test files) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 36b6f9b + 4468068 commit 029cb1b

File tree

80 files changed

+1104
-808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1104
-808
lines changed
 

‎Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -4783,6 +4783,8 @@ version = "0.0.0"
47834783
dependencies = [
47844784
"arrayvec",
47854785
"askama",
4786+
"base64",
4787+
"byteorder",
47864788
"expect-test",
47874789
"indexmap",
47884790
"itertools 0.12.1",

‎compiler/rustc_mir_transform/src/coroutine/by_move_body.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! be a coroutine body that takes all of its upvars by-move, and which we stash
44
//! into the `CoroutineInfo` for all coroutines returned by coroutine-closures.
55
6-
use rustc_data_structures::fx::FxIndexSet;
6+
use rustc_data_structures::unord::UnordSet;
77
use rustc_hir as hir;
88
use rustc_middle::mir::visit::MutVisitor;
99
use rustc_middle::mir::{self, dump_mir, MirPass};
@@ -33,7 +33,7 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {
3333
return;
3434
}
3535

36-
let mut by_ref_fields = FxIndexSet::default();
36+
let mut by_ref_fields = UnordSet::default();
3737
let by_move_upvars = Ty::new_tup_from_iter(
3838
tcx,
3939
tcx.closure_captures(coroutine_def_id).iter().enumerate().map(|(idx, capture)| {
@@ -73,7 +73,7 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {
7373

7474
struct MakeByMoveBody<'tcx> {
7575
tcx: TyCtxt<'tcx>,
76-
by_ref_fields: FxIndexSet<FieldIdx>,
76+
by_ref_fields: UnordSet<FieldIdx>,
7777
by_move_coroutine_ty: Ty<'tcx>,
7878
}
7979

@@ -89,11 +89,11 @@ impl<'tcx> MutVisitor<'tcx> for MakeByMoveBody<'tcx> {
8989
location: mir::Location,
9090
) {
9191
if place.local == ty::CAPTURE_STRUCT_LOCAL
92-
&& !place.projection.is_empty()
93-
&& let mir::ProjectionElem::Field(idx, ty) = place.projection[0]
92+
&& let Some((&mir::ProjectionElem::Field(idx, ty), projection)) =
93+
place.projection.split_first()
9494
&& self.by_ref_fields.contains(&idx)
9595
{
96-
let (begin, end) = place.projection[1..].split_first().unwrap();
96+
let (begin, end) = projection.split_first().unwrap();
9797
// FIXME(async_closures): I'm actually a bit surprised to see that we always
9898
// initially deref the by-ref upvars. If this is not actually true, then we
9999
// will at least get an ICE that explains why this isn't true :^)

0 commit comments

Comments
 (0)