Skip to content

Commit 7e0463f

Browse files
committed
Revert "comment out the old tests instead of adjusting them"
This reverts commit 906f66f.
1 parent 7830406 commit 7e0463f

File tree

8 files changed

+48
-49
lines changed

8 files changed

+48
-49
lines changed

tests/coverage/closure.cov-map

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,17 @@ Number of file 0 mappings: 6
140140
- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
141141
Highest counter ID seen: c1
142142

143-
Function name: closure::main::{closure#18}
144-
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 19, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]
143+
Function name: closure::main::{closure#18} (unused)
144+
Raw bytes (24): 0x[01, 01, 00, 04, 00, 19, 0d, 02, 1c, 00, 02, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 01, 0e]
145145
Number of files: 1
146146
- file 0 => global file 1
147-
Number of expressions: 1
148-
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
147+
Number of expressions: 0
149148
Number of file 0 mappings: 4
150-
- Code(Counter(0)) at (prev + 25, 13) to (start + 2, 28)
151-
- Code(Counter(1)) at (prev + 2, 29) to (start + 2, 18)
152-
- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18)
153-
= (c0 - c1)
154-
- Code(Counter(0)) at (prev + 1, 17) to (start + 1, 14)
155-
Highest counter ID seen: c1
149+
- Code(Zero) at (prev + 25, 13) to (start + 2, 28)
150+
- Code(Zero) at (prev + 2, 29) to (start + 2, 18)
151+
- Code(Zero) at (prev + 2, 17) to (start + 0, 18)
152+
- Code(Zero) at (prev + 1, 17) to (start + 1, 14)
153+
Highest counter ID seen: (none)
156154

157155
Function name: closure::main::{closure#19}
158156
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 43, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]

tests/mir-opt/const_prop/read_immutable_static.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ static FOO: u8 = 2;
66
fn main() {
77
// CHECK-LABEL: fn main(
88
// CHECK: debug x => [[x:_.*]];
9-
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
10-
// COM: CHECK: [[x]] = const 4_u8;
9+
// CHECK-NOT: [[x]] = const 4_u8;
1110
let x = FOO + FOO;
1211
}

tests/mir-opt/const_prop/ref_deref_project.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
fn main() {
66
// CHECK-LABEL: fn main(
77
// CHECK: debug a => [[a:_.*]];
8-
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
9-
// COM: CHECK: [[a]] = const 5_i32;
8+
// CHECK-NOT: [[a]] = const 5_i32;
109
let a = *(&(4, 5).1);
1110
}

tests/mir-opt/const_prop/slice_len.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ fn main() {
88
// CHECK-LABEL: fn main(
99
// CHECK: debug a => [[a:_.*]];
1010
// CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize, AsCast));
11-
// Disabled due to <https://github.com/rust-lang/rust/issues/130853>
12-
// COM: CHECK: assert(const true,
13-
// COM: CHECK: [[a]] = const 2_u32;
11+
// CHECK-NOT: assert(const true,
12+
// CHECK-NOT: [[a]] = const 2_u32;
1413
let a = (&[1u32, 2, 3] as &[u32])[1];
1514
}

tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
let mut _3: fn(u8) -> u8;
99
let _5: ();
1010
let mut _6: fn(u8) -> u8;
11-
let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
11+
let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21};
1212
let _10: ();
1313
let mut _11: fn();
14-
let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
14+
let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21};
1515
let _14: ();
1616
let mut _15: fn();
1717
scope 1 {
1818
debug f => _1;
1919
let _4: fn(u8) -> u8;
2020
scope 2 {
2121
debug g => _4;
22-
let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
22+
let _7: {closure@$DIR/gvn.rs:620:19: 620:21};
2323
scope 3 {
2424
debug closure => _7;
2525
let _8: fn();
@@ -62,16 +62,16 @@
6262
StorageDead(_6);
6363
StorageDead(_5);
6464
- StorageLive(_7);
65-
- _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
65+
- _7 = {closure@$DIR/gvn.rs:620:19: 620:21};
6666
- StorageLive(_8);
6767
+ nop;
68-
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
68+
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
6969
+ nop;
7070
StorageLive(_9);
7171
- _9 = copy _7;
7272
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
73-
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
74-
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
73+
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
74+
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
7575
StorageDead(_9);
7676
StorageLive(_10);
7777
StorageLive(_11);
@@ -88,8 +88,8 @@
8888
StorageLive(_13);
8989
- _13 = copy _7;
9090
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
91-
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
92-
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
91+
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
92+
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
9393
StorageDead(_13);
9494
StorageLive(_14);
9595
StorageLive(_15);

tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
let mut _3: fn(u8) -> u8;
99
let _5: ();
1010
let mut _6: fn(u8) -> u8;
11-
let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
11+
let mut _9: {closure@$DIR/gvn.rs:620:19: 620:21};
1212
let _10: ();
1313
let mut _11: fn();
14-
let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
14+
let mut _13: {closure@$DIR/gvn.rs:620:19: 620:21};
1515
let _14: ();
1616
let mut _15: fn();
1717
scope 1 {
1818
debug f => _1;
1919
let _4: fn(u8) -> u8;
2020
scope 2 {
2121
debug g => _4;
22-
let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
22+
let _7: {closure@$DIR/gvn.rs:620:19: 620:21};
2323
scope 3 {
2424
debug closure => _7;
2525
let _8: fn();
@@ -62,16 +62,16 @@
6262
StorageDead(_6);
6363
StorageDead(_5);
6464
- StorageLive(_7);
65-
- _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
65+
- _7 = {closure@$DIR/gvn.rs:620:19: 620:21};
6666
- StorageLive(_8);
6767
+ nop;
68-
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
68+
+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
6969
+ nop;
7070
StorageLive(_9);
7171
- _9 = copy _7;
7272
- _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
73-
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
74-
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
73+
+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
74+
+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
7575
StorageDead(_9);
7676
StorageLive(_10);
7777
StorageLive(_11);
@@ -88,8 +88,8 @@
8888
StorageLive(_13);
8989
- _13 = copy _7;
9090
- _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
91-
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
92-
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
91+
+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21};
92+
+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:620:19: 620:21} as fn() (PointerCoercion(ClosureFnPointer(Safe), AsCast));
9393
StorageDead(_13);
9494
StorageLive(_14);
9595
StorageLive(_15);

tests/mir-opt/gvn.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,18 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) {
100100
opaque((x * y) - y);
101101

102102
// We cannot substitute through an immutable reference.
103-
// (Disabled due to <https://github.com/rust-lang/rust/issues/130853>)
104103
// CHECK: [[ref:_.*]] = &_3;
105104
// CHECK: [[deref:_.*]] = copy (*[[ref]]);
106-
// COM: CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1);
107-
// COM: CHECK: opaque::<u64>(copy [[addref]])
108-
// COM: CHECK: opaque::<u64>(copy [[addref]])
105+
// CHECK: [[addref:_.*]] = Add(move [[deref]], copy _1);
106+
// CHECK: opaque::<u64>(move [[addref]])
107+
// CHECK: [[deref2:_.*]] = copy (*[[ref]]);
108+
// CHECK: [[addref2:_.*]] = Add(move [[deref2]], copy _1);
109+
// CHECK: opaque::<u64>(move [[addref2]])
109110
let a = &z;
110111
opaque(*a + x);
111112
opaque(*a + x);
112113

113-
// And certainly not through a mutable reference or a pointer.
114+
// But not through a mutable reference or a pointer.
114115
// CHECK: [[mut:_.*]] = &mut _3;
115116
// CHECK: [[addmut:_.*]] = Add(
116117
// CHECK: opaque::<u64>(move [[addmut]])
@@ -142,9 +143,11 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) {
142143
// Important: `e` is not `a`!
143144
// CHECK: [[ref2:_.*]] = &_3;
144145
// CHECK: [[deref2:_.*]] = copy (*[[ref2]]);
145-
// COM: CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1);
146-
// COM: CHECK: opaque::<u64>(copy [[addref2]])
147-
// COM: CHECK: opaque::<u64>(copy [[addref2]])
146+
// CHECK: [[addref2:_.*]] = Add(move [[deref2]], copy _1);
147+
// CHECK: opaque::<u64>(move [[addref2]])
148+
// CHECK: [[deref3:_.*]] = copy (*[[ref2]]);
149+
// CHECK: [[addref3:_.*]] = Add(move [[deref3]], copy _1);
150+
// CHECK: opaque::<u64>(move [[addref3]])
148151
let e = &z;
149152
opaque(*e + x);
150153
opaque(*e + x);
@@ -499,8 +502,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) {
499502
// Do not reuse dereferences of `&Freeze`.
500503
// CHECK: [[ref:_.*]] = &(*_1);
501504
// CHECK: [[st7:_.*]] = copy (*[[ref]]);
502-
// COM: CHECK: opaque::<u32>(copy [[st7]])
503-
// COM: CHECK: opaque::<u32>(copy [[st7]])
505+
// CHECK: opaque::<u32>(move [[st7]])
506+
// CHECK: [[st8:_.*]] = copy (*[[ref]]);
507+
// CHECK: opaque::<u32>(move [[st8]])
504508
let z = &*t;
505509
opaque(*z);
506510
opaque(*z);
@@ -519,8 +523,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) {
519523

520524
// `*s` is not Copy, but `(*s).0` is, but we still cannot reuse.
521525
// CHECK: [[st10:_.*]] = copy ((*_3).0: u32);
522-
// COM: CHECK: opaque::<u32>(copy [[st10]])
523-
// COM: CHECK: opaque::<u32>(copy [[st10]])
526+
// CHECK: opaque::<u32>(move [[st10]])
527+
// CHECK: [[st11:_.*]] = copy ((*_3).0: u32);
528+
// CHECK: opaque::<u32>(move [[st11]])
524529
opaque(s.0);
525530
opaque(s.0);
526531
}
@@ -737,7 +742,7 @@ fn borrowed<T: Copy + Freeze>(x: T) {
737742
// CHECK: bb1: {
738743
// CHECK-NEXT: _0 = opaque::<T>(copy _1)
739744
// CHECK: bb2: {
740-
// COM: CHECK-NEXT: _0 = opaque::<T>(copy _1)
745+
// CHECK-NEXT: _0 = opaque::<T>(copy (*_3))
741746
mir! {
742747
{
743748
let a = x;

tests/mir-opt/pre-codegen/deref_nested_borrows.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//! Regression test for <https://github.com/rust-lang/rust/issues/130853>
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32

43
fn src(x: &&u8) -> bool {

0 commit comments

Comments
 (0)