From 31d101093c134e69a31ba58893e56647a5831299 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Tue, 12 Sep 2023 16:44:53 +0000 Subject: [PATCH] Generate ValTrees in DataflowConstProp. --- .../src/dataflow_const_prop.rs | 99 ++++++++++++++++++- .../const_debuginfo.main.ConstDebugInfo.diff | 5 +- ...ed.main.DataflowConstProp.panic-abort.diff | 4 +- ...d.main.DataflowConstProp.panic-unwind.diff | 4 +- .../enum.simple.DataflowConstProp.32bit.diff | 3 +- .../enum.simple.DataflowConstProp.64bit.diff | 3 +- .../enum.statics.DataflowConstProp.32bit.diff | 3 +- .../enum.statics.DataflowConstProp.64bit.diff | 3 +- ...ow.main.DataflowConstProp.panic-abort.diff | 2 +- ...w.main.DataflowConstProp.panic-unwind.diff | 2 +- ...pr_transparent.main.DataflowConstProp.diff | 5 +- .../struct.main.DataflowConstProp.32bit.diff | 59 ++++++++--- .../struct.main.DataflowConstProp.64bit.diff | 59 ++++++++--- tests/mir-opt/dataflow-const-prop/struct.rs | 2 + .../tuple.main.DataflowConstProp.diff | 29 +++++- tests/mir-opt/dataflow-const-prop/tuple.rs | 2 + 16 files changed, 234 insertions(+), 50 deletions(-) diff --git a/compiler/rustc_mir_transform/src/dataflow_const_prop.rs b/compiler/rustc_mir_transform/src/dataflow_const_prop.rs index 85a0be8a44c..762f57ad29e 100644 --- a/compiler/rustc_mir_transform/src/dataflow_const_prop.rs +++ b/compiler/rustc_mir_transform/src/dataflow_const_prop.rs @@ -557,11 +557,102 @@ impl<'tcx, 'locals> Collector<'tcx, 'locals> { state: &State>, map: &Map, ) -> Option> { - let FlatSet::Elem(Scalar::Int(value)) = state.get(place.as_ref(), &map) else { - return None; - }; let ty = place.ty(self.local_decls, self.patch.tcx).ty; - Some(Const::Val(ConstValue::Scalar(value.into()), ty)) + let place = map.find(place.as_ref())?; + if let FlatSet::Elem(Scalar::Int(value)) = state.get_idx(place, map) { + Some(Const::Val(ConstValue::Scalar(value.into()), ty)) + } else { + let valtree = self.try_make_valtree(place, ty, state, map)?; + let constant = ty::Const::new_value(self.patch.tcx, valtree, ty); + Some(Const::Ty(constant)) + } + } + + fn try_make_valtree( + &self, + place: PlaceIndex, + ty: Ty<'tcx>, + state: &State>, + map: &Map, + ) -> Option> { + let tcx = self.patch.tcx; + match ty.kind() { + // ZSTs. + ty::FnDef(..) => Some(ty::ValTree::zst()), + + // Scalars. + ty::Bool | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Char => { + if let FlatSet::Elem(Scalar::Int(value)) = state.get_idx(place, map) { + Some(ty::ValTree::Leaf(value)) + } else { + None + } + } + + // Unsupported for now. + ty::Array(_, _) => None, + + ty::Tuple(elem_tys) => { + let branches = elem_tys + .iter() + .enumerate() + .map(|(i, ty)| { + let field = map.apply(place, TrackElem::Field(FieldIdx::from_usize(i)))?; + self.try_make_valtree(field, ty, state, map) + }) + .collect::>>()?; + Some(ty::ValTree::Branch(tcx.arena.alloc_from_iter(branches.into_iter()))) + } + + ty::Adt(def, args) => { + if def.is_union() { + return None; + } + + let (variant_idx, variant_def, variant_place) = if def.is_enum() { + let discr = map.apply(place, TrackElem::Discriminant)?; + let FlatSet::Elem(Scalar::Int(discr)) = state.get_idx(discr, map) else { + return None; + }; + let discr_bits = discr.assert_bits(discr.size()); + let (variant, _) = + def.discriminants(tcx).find(|(_, var)| discr_bits == var.val)?; + let variant_place = map.apply(place, TrackElem::Variant(variant))?; + let variant_int = ty::ValTree::Leaf(variant.as_u32().into()); + (Some(variant_int), def.variant(variant), variant_place) + } else { + (None, def.non_enum_variant(), place) + }; + + let branches = variant_def + .fields + .iter_enumerated() + .map(|(i, field)| { + let ty = field.ty(tcx, args); + let field = map.apply(variant_place, TrackElem::Field(i))?; + self.try_make_valtree(field, ty, state, map) + }) + .collect::>>()?; + Some(ty::ValTree::Branch( + tcx.arena.alloc_from_iter(variant_idx.into_iter().chain(branches)), + )) + } + + // Do not attempt to support indirection in constants. + ty::Ref(..) | ty::RawPtr(..) | ty::FnPtr(..) | ty::Str | ty::Slice(_) => None, + + ty::Never + | ty::Foreign(..) + | ty::Alias(..) + | ty::Param(_) + | ty::Bound(..) + | ty::Placeholder(..) + | ty::Closure(..) + | ty::Coroutine(..) + | ty::Dynamic(..) => None, + + ty::Error(_) | ty::Infer(..) | ty::CoroutineWitness(..) => bug!(), + } } } diff --git a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff index ed47baa67da..0934ee34617 100644 --- a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff +++ b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff @@ -41,7 +41,8 @@ + debug ((f: (bool, bool, u32)).2: u32) => const 123_u32; let _10: std::option::Option; scope 7 { - debug o => _10; +- debug o => _10; ++ debug o => const Option::::Some(99); let _17: u32; let _18: u32; scope 8 { @@ -81,7 +82,7 @@ _15 = const false; _16 = const 123_u32; StorageLive(_10); - _10 = Option::::Some(const 99_u16); + _10 = const Option::::Some(99); _17 = const 32_u32; _18 = const 32_u32; StorageLive(_11); diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff index 2f1a70f32d0..111be450c79 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff @@ -43,7 +43,7 @@ - _6 = CheckedAdd(_4, _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable]; + _5 = const 2_i32; -+ _6 = CheckedAdd(const 1_i32, const 2_i32); ++ _6 = const (3, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> [success: bb1, unwind unreachable]; } @@ -60,7 +60,7 @@ - _10 = CheckedAdd(_9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable]; + _9 = const i32::MAX; -+ _10 = CheckedAdd(const i32::MAX, const 1_i32); ++ _10 = const (i32::MIN, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> [success: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff index 0d8a9aca3d8..733100a889b 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff @@ -43,7 +43,7 @@ - _6 = CheckedAdd(_4, _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind continue]; + _5 = const 2_i32; -+ _6 = CheckedAdd(const 1_i32, const 2_i32); ++ _6 = const (3, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> [success: bb1, unwind continue]; } @@ -60,7 +60,7 @@ - _10 = CheckedAdd(_9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind continue]; + _9 = const i32::MAX; -+ _10 = CheckedAdd(const i32::MAX, const 1_i32); ++ _10 = const (i32::MIN, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> [success: bb2, unwind continue]; } diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff index 3946e7c7d96..1e7fdd3b1a0 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff @@ -23,7 +23,8 @@ bb0: { StorageLive(_1); - _1 = E::V1(const 0_i32); +- _1 = E::V1(const 0_i32); ++ _1 = const E::V1(0); StorageLive(_2); - _3 = discriminant(_1); - switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff index 3946e7c7d96..1e7fdd3b1a0 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff @@ -23,7 +23,8 @@ bb0: { StorageLive(_1); - _1 = E::V1(const 0_i32); +- _1 = E::V1(const 0_i32); ++ _1 = const E::V1(0); StorageLive(_2); - _3 = discriminant(_1); - switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff index 1348b279330..c5c95bc6cd1 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff @@ -44,7 +44,8 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC1: &E}; - _1 = (*_2); +- _1 = (*_2); ++ _1 = const E::V1(0); StorageDead(_2); StorageLive(_3); - _4 = discriminant(_1); diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff index 66929e886d3..48897b93e46 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff @@ -44,7 +44,8 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC1: &E}; - _1 = (*_2); +- _1 = (*_2); ++ _1 = const E::V1(0); StorageDead(_2); StorageLive(_3); - _4 = discriminant(_1); diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff index 87bb1454c96..b5f7f2a472c 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff @@ -23,7 +23,7 @@ StorageLive(_4); - _4 = CheckedAdd(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; -+ _4 = CheckedAdd(const u8::MAX, const 1_u8); ++ _4 = const (0, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff index b2f13640a4c..e2e799650aa 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff @@ -23,7 +23,7 @@ StorageLive(_4); - _4 = CheckedAdd(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; -+ _4 = CheckedAdd(const u8::MAX, const 1_u8); ++ _4 = const (0, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff index 4b1a8d932c6..4530d8b627b 100644 --- a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff @@ -17,7 +17,8 @@ bb0: { StorageLive(_1); - _1 = I32(const 0_i32); +- _1 = I32(const 0_i32); ++ _1 = const I32(0); StorageLive(_2); StorageLive(_3); StorageLive(_4); @@ -31,7 +32,7 @@ StorageDead(_5); StorageDead(_4); - _2 = I32(move _3); -+ _2 = I32(const 0_i32); ++ _2 = const I32(0); StorageDead(_3); _0 = const (); StorageDead(_2); diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff index e80f31ca934..8d277459d3b 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff @@ -9,11 +9,15 @@ let mut _6: i32; let mut _11: BigStruct; let mut _16: &&BigStruct; - let mut _17: &BigStruct; - let mut _18: &BigStruct; - let mut _19: &BigStruct; - let mut _20: &BigStruct; - let mut _21: &BigStruct; + let mut _18: S; + let mut _19: u8; + let mut _20: f32; + let mut _21: S; + let mut _22: &BigStruct; + let mut _23: &BigStruct; + let mut _24: &BigStruct; + let mut _25: &BigStruct; + let mut _26: &BigStruct; scope 1 { debug s => _1; let _2: i32; @@ -40,6 +44,10 @@ debug b => _13; debug c => _14; debug d => _15; + let _17: BigStruct; + scope 6 { + debug bs => _17; + } } } } @@ -48,7 +56,8 @@ bb0: { StorageLive(_1); - _1 = S(const 1_i32); +- _1 = S(const 1_i32); ++ _1 = const S(1); StorageLive(_2); StorageLive(_3); - _3 = (_1.0: i32); @@ -85,25 +94,45 @@ StorageDead(_11); StorageLive(_16); _16 = const {ALLOC1: &&BigStruct}; - _17 = deref_copy (*_16); + _22 = deref_copy (*_16); StorageLive(_12); - _18 = deref_copy (*_16); -- _12 = ((*_18).0: S); + _23 = deref_copy (*_16); +- _12 = ((*_23).0: S); + _12 = const S(1_i32); StorageLive(_13); - _19 = deref_copy (*_16); -- _13 = ((*_19).1: u8); + _24 = deref_copy (*_16); +- _13 = ((*_24).1: u8); + _13 = const 5_u8; StorageLive(_14); - _20 = deref_copy (*_16); -- _14 = ((*_20).2: f32); + _25 = deref_copy (*_16); +- _14 = ((*_25).2: f32); + _14 = const 7f32; StorageLive(_15); - _21 = deref_copy (*_16); -- _15 = ((*_21).3: S); + _26 = deref_copy (*_16); +- _15 = ((*_26).3: S); + _15 = const S(13_i32); StorageDead(_16); + StorageLive(_17); + StorageLive(_18); +- _18 = _12; ++ _18 = const S(1_i32); + StorageLive(_19); +- _19 = _13; ++ _19 = const 5_u8; + StorageLive(_20); +- _20 = _14; ++ _20 = const 7f32; + StorageLive(_21); +- _21 = _15; +- _17 = BigStruct(move _18, move _19, move _20, move _21); ++ _21 = const S(13_i32); ++ _17 = const BigStruct(S(1), 5, 7f32, S(13)); + StorageDead(_21); + StorageDead(_20); + StorageDead(_19); + StorageDead(_18); _0 = const (); + StorageDead(_17); StorageDead(_15); StorageDead(_14); StorageDead(_13); diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff index de9cf197199..fca94beb9ab 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff @@ -9,11 +9,15 @@ let mut _6: i32; let mut _11: BigStruct; let mut _16: &&BigStruct; - let mut _17: &BigStruct; - let mut _18: &BigStruct; - let mut _19: &BigStruct; - let mut _20: &BigStruct; - let mut _21: &BigStruct; + let mut _18: S; + let mut _19: u8; + let mut _20: f32; + let mut _21: S; + let mut _22: &BigStruct; + let mut _23: &BigStruct; + let mut _24: &BigStruct; + let mut _25: &BigStruct; + let mut _26: &BigStruct; scope 1 { debug s => _1; let _2: i32; @@ -40,6 +44,10 @@ debug b => _13; debug c => _14; debug d => _15; + let _17: BigStruct; + scope 6 { + debug bs => _17; + } } } } @@ -48,7 +56,8 @@ bb0: { StorageLive(_1); - _1 = S(const 1_i32); +- _1 = S(const 1_i32); ++ _1 = const S(1); StorageLive(_2); StorageLive(_3); - _3 = (_1.0: i32); @@ -85,25 +94,45 @@ StorageDead(_11); StorageLive(_16); _16 = const {ALLOC1: &&BigStruct}; - _17 = deref_copy (*_16); + _22 = deref_copy (*_16); StorageLive(_12); - _18 = deref_copy (*_16); -- _12 = ((*_18).0: S); + _23 = deref_copy (*_16); +- _12 = ((*_23).0: S); + _12 = const S(1_i32); StorageLive(_13); - _19 = deref_copy (*_16); -- _13 = ((*_19).1: u8); + _24 = deref_copy (*_16); +- _13 = ((*_24).1: u8); + _13 = const 5_u8; StorageLive(_14); - _20 = deref_copy (*_16); -- _14 = ((*_20).2: f32); + _25 = deref_copy (*_16); +- _14 = ((*_25).2: f32); + _14 = const 7f32; StorageLive(_15); - _21 = deref_copy (*_16); -- _15 = ((*_21).3: S); + _26 = deref_copy (*_16); +- _15 = ((*_26).3: S); + _15 = const S(13_i32); StorageDead(_16); + StorageLive(_17); + StorageLive(_18); +- _18 = _12; ++ _18 = const S(1_i32); + StorageLive(_19); +- _19 = _13; ++ _19 = const 5_u8; + StorageLive(_20); +- _20 = _14; ++ _20 = const 7f32; + StorageLive(_21); +- _21 = _15; +- _17 = BigStruct(move _18, move _19, move _20, move _21); ++ _21 = const S(13_i32); ++ _17 = const BigStruct(S(1), 5, 7f32, S(13)); + StorageDead(_21); + StorageDead(_20); + StorageDead(_19); + StorageDead(_18); _0 = const (); + StorageDead(_17); StorageDead(_15); StorageDead(_14); StorageDead(_13); diff --git a/tests/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs index 7b0646a5356..5c6edeb3866 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.rs +++ b/tests/mir-opt/dataflow-const-prop/struct.rs @@ -20,4 +20,6 @@ fn main() { static STAT: &BigStruct = &BigStruct(S(1), 5, 7., S(13)); let BigStruct(a, b, c, d) = *STAT; + + let bs = BigStruct(a, b, c, d); } diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff index 5e385d21ec6..21c9b9d1eb9 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff @@ -11,6 +11,9 @@ let mut _8: i32; let mut _9: i32; let mut _10: i32; + let mut _12: i32; + let mut _13: (i32, i32); + let mut _14: i32; scope 1 { debug a => _1; let _2: i32; @@ -19,13 +22,18 @@ let _6: i32; scope 3 { debug c => _6; + let _11: (i32, (i32, i32), i32); + scope 4 { + debug d => _11; + } } } } bb0: { StorageLive(_1); - _1 = (const 1_i32, const 2_i32); +- _1 = (const 1_i32, const 2_i32); ++ _1 = const (1, 2); StorageLive(_2); StorageLive(_3); StorageLive(_4); @@ -41,7 +49,8 @@ - _2 = Add(move _3, const 3_i32); + _2 = const 6_i32; StorageDead(_3); - _1 = (const 2_i32, const 3_i32); +- _1 = (const 2_i32, const 3_i32); ++ _1 = const (2, 3); StorageLive(_6); StorageLive(_7); StorageLive(_8); @@ -61,7 +70,23 @@ + _6 = const 11_i32; StorageDead(_10); StorageDead(_7); + StorageLive(_11); + StorageLive(_12); +- _12 = _2; ++ _12 = const 6_i32; + StorageLive(_13); +- _13 = _1; ++ _13 = const (2, 3); + StorageLive(_14); +- _14 = _6; +- _11 = (move _12, move _13, move _14); ++ _14 = const 11_i32; ++ _11 = const (6, (2, 3), 11); + StorageDead(_14); + StorageDead(_13); + StorageDead(_12); _0 = const (); + StorageDead(_11); StorageDead(_6); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/tuple.rs b/tests/mir-opt/dataflow-const-prop/tuple.rs index c63ce8b140f..7691bc8d7c5 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.rs +++ b/tests/mir-opt/dataflow-const-prop/tuple.rs @@ -7,4 +7,6 @@ fn main() { let b = a.0 + a.1 + 3; a = (2, 3); let c = a.0 + a.1 + b; + + let d = (b, a, c); }