Skip to content

Commit 9dee4e4

Browse files
committedFeb 4, 2023
Auto merge of #107267 - cjgillot:keep-aggregate, r=oli-obk
Do not deaggregate MIR This turns out to simplify a lot of things. I haven't checked the consequences for miri yet. cc `@JakobDegen` r? `@oli-obk`
2 parents 4aa6afa + 5c39ba2 commit 9dee4e4

File tree

114 files changed

+658
-1039
lines changed

Some content is hidden

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

114 files changed

+658
-1039
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
26452645
operands,
26462646
) = rvalue
26472647
{
2648+
let def_id = def_id.expect_local();
26482649
for operand in operands {
26492650
let (Operand::Copy(assigned_from) | Operand::Move(assigned_from)) = operand else {
26502651
continue;
@@ -2667,7 +2668,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
26672668
// into a place then we should annotate the closure in
26682669
// case it ends up being assigned into the return place.
26692670
annotated_closure =
2670-
self.annotate_fn_sig(*def_id, substs.as_closure().sig());
2671+
self.annotate_fn_sig(def_id, substs.as_closure().sig());
26712672
debug!(
26722673
"annotate_argument_and_return_for_borrow: \
26732674
annotated_closure={:?} assigned_from_local={:?} \

‎compiler/rustc_borrowck/src/diagnostics/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
817817
&& let AggregateKind::Closure(def_id, _) | AggregateKind::Generator(def_id, _, _) = **kind
818818
{
819819
debug!("move_spans: def_id={:?} places={:?}", def_id, places);
820+
let def_id = def_id.expect_local();
820821
if let Some((args_span, generator_kind, capture_kind_span, path_span)) =
821822
self.closure_span(def_id, moved_place, places)
822823
{
@@ -945,6 +946,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
945946
box AggregateKind::Generator(def_id, _, _) => (def_id, true),
946947
_ => continue,
947948
};
949+
let def_id = def_id.expect_local();
948950

949951
debug!(
950952
"borrow_spans: def_id={:?} is_generator={:?} places={:?}",

0 commit comments

Comments
 (0)