Skip to content

Commit db019f2

Browse files
committed
try to bless 32bit mir tests manually
1 parent fff06e5 commit db019f2

6 files changed

+42
-22
lines changed

Cargo.lock

+36-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ dependencies = [
369369
"tar",
370370
"tempfile",
371371
"termcolor",
372-
"toml",
372+
"toml_edit",
373373
"unicode-width",
374374
"unicode-xid",
375375
"url 2.2.2",
@@ -455,7 +455,7 @@ dependencies = [
455455
"serde_json",
456456
"tar",
457457
"termcolor",
458-
"toml",
458+
"toml_edit",
459459
"url 2.2.2",
460460
]
461461

@@ -710,6 +710,16 @@ dependencies = [
710710
"winapi",
711711
]
712712

713+
[[package]]
714+
name = "combine"
715+
version = "4.6.3"
716+
source = "registry+https://github.com/rust-lang/crates.io-index"
717+
checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062"
718+
dependencies = [
719+
"bytes",
720+
"memchr",
721+
]
722+
713723
[[package]]
714724
name = "commoncrypto"
715725
version = "0.2.0"
@@ -1939,6 +1949,15 @@ dependencies = [
19391949
"unicase",
19401950
]
19411951

1952+
[[package]]
1953+
name = "kstring"
1954+
version = "1.0.6"
1955+
source = "registry+https://github.com/rust-lang/crates.io-index"
1956+
checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526"
1957+
dependencies = [
1958+
"serde",
1959+
]
1960+
19421961
[[package]]
19431962
name = "lazy_static"
19441963
version = "1.4.0"
@@ -3146,13 +3165,14 @@ dependencies = [
31463165
"tokio-stream",
31473166
"tokio-util",
31483167
"toml",
3168+
"toml_edit",
31493169
"url 2.2.2",
31503170
"walkdir",
31513171
]
31523172

31533173
[[package]]
31543174
name = "rls-analysis"
3155-
version = "0.18.2"
3175+
version = "0.18.3"
31563176
dependencies = [
31573177
"derive-new",
31583178
"env_logger 0.9.0",
@@ -5151,6 +5171,19 @@ dependencies = [
51515171
"serde",
51525172
]
51535173

5174+
[[package]]
5175+
name = "toml_edit"
5176+
version = "0.13.4"
5177+
source = "registry+https://github.com/rust-lang/crates.io-index"
5178+
checksum = "744e9ed5b352340aa47ce033716991b5589e23781acb97cad37d4ea70560f55b"
5179+
dependencies = [
5180+
"combine",
5181+
"indexmap",
5182+
"itertools 0.10.1",
5183+
"kstring",
5184+
"serde",
5185+
]
5186+
51545187
[[package]]
51555188
name = "topological-sort"
51565189
version = "0.1.0"

compiler/rustc_middle/src/mir/pretty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -686,15 +686,15 @@ pub fn write_allocations<'tcx>(
686686
struct CollectAllocIds(BTreeSet<AllocId>);
687687

688688
impl<'tcx> Visitor<'tcx> for CollectAllocIds {
689-
fn visit_const(&mut self, c: &&'tcx ty::Const<'tcx>, _loc: Location) {
690-
if let ty::ConstKind::Value(val) = c.val {
689+
fn visit_const(&mut self, c: ty::Const<'tcx>, _loc: Location) {
690+
if let ty::ConstKind::Value(val) = c.val() {
691691
self.0.extend(alloc_ids_from_const(val));
692692
}
693693
}
694694

695695
fn visit_constant(&mut self, c: &Constant<'tcx>, loc: Location) {
696696
match c.literal {
697-
ConstantKind::Ty(c) => self.visit_const(&c, loc),
697+
ConstantKind::Ty(c) => self.visit_const(c, loc),
698698
ConstantKind::Val(val, _) => {
699699
self.0.extend(alloc_ids_from_const(val));
700700
}

compiler/rustc_middle/src/thir.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
717717
Some(&adt_def.variants[variant_index])
718718
}
719719
_ => self.ty.ty_adt_def().and_then(|adt| {
720-
if !adt.is_enum() {
721-
Some(adt.non_enum_variant())
722-
} else {
723-
None
724-
}
720+
if !adt.is_enum() { Some(adt.non_enum_variant()) } else { None }
725721
}),
726722
};
727723

src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ fn main() -> () {
99
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
12-
// ty::Const
13-
// + ty: &&[(std::option::Option<i32>, &[&str])]
14-
// + val: Value(Scalar(alloc1))
1512
// mir::Constant
1613
// + span: $DIR/const_allocation.rs:8:5: 8:8
17-
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
14+
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
1815
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
1916
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
2017
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9

src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ fn main() -> () {
99
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
12-
// ty::Const
13-
// + ty: &&[(std::option::Option<i32>, &[&u8])]
14-
// + val: Value(Scalar(alloc1))
1512
// mir::Constant
1613
// + span: $DIR/const_allocation2.rs:5:5: 5:8
17-
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
14+
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
1815
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
1916
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
2017
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9

src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ fn main() -> () {
99
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
1111
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
12-
// ty::Const
13-
// + ty: &&Packed
14-
// + val: Value(Scalar(alloc1))
1512
// mir::Constant
1613
// + span: $DIR/const_allocation3.rs:5:5: 5:8
1714
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }

0 commit comments

Comments
 (0)