Skip to content

Commit 6a0b218

Browse files
committed
Stop deaggregating enums in MIR.
1 parent b62a9da commit 6a0b218

File tree

41 files changed

+165
-439
lines changed

Some content is hidden

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

41 files changed

+165
-439
lines changed

compiler/rustc_const_eval/src/transform/validate.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use rustc_middle::mir::interpret::Scalar;
88
use rustc_middle::mir::visit::NonUseContext::VarDebugInfo;
99
use rustc_middle::mir::visit::{PlaceContext, Visitor};
1010
use rustc_middle::mir::{
11-
traversal, AggregateKind, BasicBlock, BinOp, Body, BorrowKind, CastKind, CopyNonOverlapping,
12-
Local, Location, MirPass, MirPhase, NonDivergingIntrinsic, Operand, Place, PlaceElem, PlaceRef,
13-
ProjectionElem, RetagKind, RuntimePhase, Rvalue, SourceScope, Statement, StatementKind,
14-
Terminator, TerminatorKind, UnOp, START_BLOCK,
11+
traversal, BasicBlock, BinOp, Body, BorrowKind, CastKind, CopyNonOverlapping, Local, Location,
12+
MirPass, MirPhase, NonDivergingIntrinsic, Operand, Place, PlaceElem, PlaceRef, ProjectionElem,
13+
RetagKind, RuntimePhase, Rvalue, SourceScope, Statement, StatementKind, Terminator,
14+
TerminatorKind, UnOp, START_BLOCK,
1515
};
1616
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt};
1717
use rustc_mir_dataflow::impls::MaybeStorageLive;
@@ -423,19 +423,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
423423
};
424424
}
425425
match rvalue {
426-
Rvalue::Use(_) | Rvalue::CopyForDeref(_) => {}
427-
Rvalue::Aggregate(agg_kind, _) => {
428-
let disallowed = match **agg_kind {
429-
AggregateKind::Array(..) => false,
430-
_ => self.mir_phase >= MirPhase::Runtime(RuntimePhase::PostCleanup),
431-
};
432-
if disallowed {
433-
self.fail(
434-
location,
435-
format!("{:?} have been lowered to field assignments", rvalue),
436-
)
437-
}
438-
}
426+
Rvalue::Use(_) | Rvalue::CopyForDeref(_) | Rvalue::Aggregate(..) => {}
439427
Rvalue::Ref(_, BorrowKind::Shallow, _) => {
440428
if self.mir_phase >= MirPhase::Runtime(RuntimePhase::Initial) {
441429
self.fail(

compiler/rustc_mir_transform/src/deaggregator.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::util::expand_aggregate;
22
use crate::MirPass;
3+
use rustc_hir::def::DefKind;
34
use rustc_middle::mir::*;
45
use rustc_middle::ty::TyCtxt;
56

@@ -11,16 +12,19 @@ impl<'tcx> MirPass<'tcx> for Deaggregator {
1112
for bb in basic_blocks {
1213
bb.expand_statements(|stmt| {
1314
// FIXME(eddyb) don't match twice on `stmt.kind` (post-NLL).
14-
match stmt.kind {
15-
// FIXME(#48193) Deaggregate arrays when it's cheaper to do so.
16-
StatementKind::Assign(box (
17-
_,
18-
Rvalue::Aggregate(box AggregateKind::Array(_), _),
19-
)) => {
20-
return None;
21-
}
22-
StatementKind::Assign(box (_, Rvalue::Aggregate(_, _))) => {}
23-
_ => return None,
15+
let StatementKind::Assign(box (
16+
_, Rvalue::Aggregate(box ref kind, _))
17+
) = stmt.kind else { return None };
18+
19+
// FIXME(#48193) Deaggregate arrays when it's cheaper to do so.
20+
if let AggregateKind::Array(_) = kind {
21+
return None;
22+
}
23+
24+
if let AggregateKind::Adt(def_id, ..) = kind
25+
&& matches!(tcx.def_kind(def_id), DefKind::Enum)
26+
{
27+
return None;
2428
}
2529

2630
let stmt = stmt.replace_nop();

compiler/rustc_mir_transform/src/generator.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
5353
use crate::deref_separator::deref_finder;
5454
use crate::simplify;
55-
use crate::util::expand_aggregate;
5655
use crate::MirPass;
5756
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5857
use rustc_errors::pluralize;
@@ -272,31 +271,26 @@ impl<'tcx> TransformVisitor<'tcx> {
272271
assert_eq!(self.state_adt_ref.variant(idx).fields.len(), 0);
273272

274273
// FIXME(swatinem): assert that `val` is indeed unit?
275-
statements.extend(expand_aggregate(
276-
Place::return_place(),
277-
std::iter::empty(),
278-
kind,
274+
statements.push(Statement {
275+
kind: StatementKind::Assign(Box::new((
276+
Place::return_place(),
277+
Rvalue::Aggregate(Box::new(kind), vec![]),
278+
))),
279279
source_info,
280-
self.tcx,
281-
));
280+
});
282281
return;
283282
}
284283

285284
// else: `Poll::Ready(x)`, `GeneratorState::Yielded(x)` or `GeneratorState::Complete(x)`
286285
assert_eq!(self.state_adt_ref.variant(idx).fields.len(), 1);
287286

288-
let ty = self
289-
.tcx
290-
.bound_type_of(self.state_adt_ref.variant(idx).fields[0].did)
291-
.subst(self.tcx, self.state_substs);
292-
293-
statements.extend(expand_aggregate(
294-
Place::return_place(),
295-
std::iter::once((val, ty)),
296-
kind,
287+
statements.push(Statement {
288+
kind: StatementKind::Assign(Box::new((
289+
Place::return_place(),
290+
Rvalue::Aggregate(Box::new(kind), vec![val]),
291+
))),
297292
source_info,
298-
self.tcx,
299-
));
293+
});
300294
}
301295

302296
// Create a Place referencing a generator struct field

compiler/rustc_mir_transform/src/shim.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_target::spec::abi::Abi;
1515
use std::fmt;
1616
use std::iter;
1717

18-
use crate::util::expand_aggregate;
1918
use crate::{
2019
abort_unwinding_calls, add_call_guards, add_moves_for_packed_drops, deref_separator,
2120
pass_manager as pm, remove_noop_landing_pads, simplify,
@@ -831,19 +830,23 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> {
831830
// return;
832831
debug!("build_ctor: variant_index={:?}", variant_index);
833832

834-
let statements = expand_aggregate(
835-
Place::return_place(),
836-
adt_def.variant(variant_index).fields.iter().enumerate().map(|(idx, field_def)| {
837-
(Operand::Move(Place::from(Local::new(idx + 1))), field_def.ty(tcx, substs))
838-
}),
839-
AggregateKind::Adt(adt_def.did(), variant_index, substs, None, None),
833+
let kind = AggregateKind::Adt(adt_def.did(), variant_index, substs, None, None);
834+
let variant = adt_def.variant(variant_index);
835+
let statement = Statement {
836+
kind: StatementKind::Assign(Box::new((
837+
Place::return_place(),
838+
Rvalue::Aggregate(
839+
Box::new(kind),
840+
(0..variant.fields.len())
841+
.map(|idx| Operand::Move(Place::from(Local::new(idx + 1))))
842+
.collect(),
843+
),
844+
))),
840845
source_info,
841-
tcx,
842-
)
843-
.collect();
846+
};
844847

845848
let start_block = BasicBlockData {
846-
statements,
849+
statements: vec![statement],
847850
terminator: Some(Terminator { source_info, kind: TerminatorKind::Return }),
848851
is_cleanup: false,
849852
};

tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ fn a::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:11:14: 11:16]>
2424
bb1: {
2525
_4 = move _2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
2626
_3 = const (); // scope 0 at $DIR/async_await.rs:+0:14: +0:16
27-
Deinit(_0); // scope 0 at $DIR/async_await.rs:+0:16: +0:16
28-
((_0 as Ready).0: ()) = move _3; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
29-
discriminant(_0) = 0; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
27+
_0 = Poll::<()>::Ready(move _3); // scope 0 at $DIR/async_await.rs:+0:16: +0:16
3028
discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
3129
return; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
3230
}

tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
167167
StorageLive(_19); // scope 1 at $DIR/async_await.rs:+1:8: +1:14
168168
StorageLive(_20); // scope 1 at $DIR/async_await.rs:+1:8: +1:14
169169
_20 = (); // scope 1 at $DIR/async_await.rs:+1:8: +1:14
170-
Deinit(_0); // scope 1 at $DIR/async_await.rs:+1:8: +1:14
171-
discriminant(_0) = 1; // scope 1 at $DIR/async_await.rs:+1:8: +1:14
170+
_0 = Poll::<()>::Pending; // scope 1 at $DIR/async_await.rs:+1:8: +1:14
172171
discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3; // scope 1 at $DIR/async_await.rs:+1:8: +1:14
173172
return; // scope 1 at $DIR/async_await.rs:+1:8: +1:14
174173
}
@@ -276,8 +275,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
276275
StorageLive(_35); // scope 4 at $DIR/async_await.rs:+2:8: +2:14
277276
StorageLive(_36); // scope 4 at $DIR/async_await.rs:+2:8: +2:14
278277
_36 = (); // scope 4 at $DIR/async_await.rs:+2:8: +2:14
279-
Deinit(_0); // scope 4 at $DIR/async_await.rs:+2:8: +2:14
280-
discriminant(_0) = 1; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
278+
_0 = Poll::<()>::Pending; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
281279
discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
282280
return; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
283281
}
@@ -317,9 +315,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
317315
}
318316

319317
bb26: {
320-
Deinit(_0); // scope 0 at $DIR/async_await.rs:+3:2: +3:2
321-
((_0 as Ready).0: ()) = move _37; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
322-
discriminant(_0) = 0; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
318+
_0 = Poll::<()>::Ready(move _37); // scope 0 at $DIR/async_await.rs:+3:2: +3:2
323319
discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
324320
return; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
325321
}

tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@
7979
_15 = const false; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
8080
_16 = const 123_u32; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
8181
StorageLive(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
82-
Deinit(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
83-
((_10 as Some).0: u16) = const 99_u16; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
84-
discriminant(_10) = 1; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
82+
_10 = Option::<u16>::Some(const 99_u16); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
8583
StorageLive(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
8684
StorageLive(_18); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
8785
Deinit(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35

tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
StorageLive(_1); // scope 0 at $DIR/discriminant.rs:+1:9: +1:10
1818
StorageLive(_2); // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
1919
StorageLive(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
20-
Deinit(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
21-
((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
22-
discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
20+
- _3 = Option::<bool>::Some(const true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
2321
- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2422
- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
23+
+ _3 = const Option::<bool>::Some(true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
24+
+ // mir::Constant
25+
+ // + span: $DIR/discriminant.rs:12:34: 12:44
26+
+ // + literal: Const { ty: Option<bool>, val: Value(Scalar(0x01)) }
2527
+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2628
+ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2729
}
2830

2931
bb1: {
30-
switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
32+
- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
33+
+ switchInt(const true) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
3134
}
3235

3336
bb2: {

tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
StorageLive(_1); // scope 0 at $DIR/discriminant.rs:+1:9: +1:10
1818
StorageLive(_2); // scope 0 at $DIR/discriminant.rs:+1:13: +1:64
1919
StorageLive(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
20-
Deinit(_3); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
21-
((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
22-
discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
20+
- _3 = Option::<bool>::Some(const true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
2321
- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2422
- switchInt(move _4) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
23+
+ _3 = const Option::<bool>::Some(true); // scope 2 at $DIR/discriminant.rs:+1:34: +1:44
24+
+ // mir::Constant
25+
+ // + span: $DIR/discriminant.rs:12:34: 12:44
26+
+ // + literal: Const { ty: Option<bool>, val: Value(Scalar(0x01)) }
2527
+ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2628
+ switchInt(const 1_isize) -> [1: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
2729
}
2830

2931
bb1: {
30-
switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
32+
- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
33+
+ switchInt(const true) -> [0: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:+1:21: +1:31
3134
}
3235

3336
bb2: {

tests/mir-opt/const_prop/optimizes_into_variable.main.ConstProp.32bit.diff

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
1010
let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
1111
let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
12-
let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
12+
let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
1313
scope 1 {
1414
debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
1515
let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
@@ -52,9 +52,8 @@
5252
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
5353
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
5454
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
55-
Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
56-
_9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
57-
- _8 = _9; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
55+
_9 = Point { x: const 12_u32, y: const 42_u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
56+
- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
5857
+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
5958
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
6059
StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2

tests/mir-opt/const_prop/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.diff

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
1111
let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
1212
let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
13-
+ let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
14-
+ let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
1513
scope 1 {
1614
debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
1715
let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
@@ -47,21 +45,10 @@
4745
StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
4846
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
4947
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
50-
- StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
51-
- Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
52-
- (_9.0: u32) = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
53-
- (_9.1: u32) = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
54-
- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
55-
- StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
56-
+ StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
57-
+ StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
58-
+ Deinit(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
59-
+ Deinit(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
60-
+ _10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
61-
+ _11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
62-
+ _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
63-
+ StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
64-
+ StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
48+
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
49+
_9 = Point { x: const 12_u32, y: const 42_u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
50+
_8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
51+
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
6552
nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2
6653
StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
6754
StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2

0 commit comments

Comments
 (0)