Skip to content

Commit 99cb0c6

Browse files
committed
Bless *all* the mir-opt tests
1 parent 249a36f commit 99cb0c6

File tree

678 files changed

+3567
-3567
lines changed

Some content is hidden

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

678 files changed

+3567
-3567
lines changed

tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn address_of_reborrow() -> () {
140140
StorageLive(_6);
141141
_6 = &raw const (*_1);
142142
AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] });
143-
_5 = _6;
143+
_5 = copy _6;
144144
StorageDead(_6);
145145
StorageDead(_5);
146146
StorageLive(_7);
@@ -153,7 +153,7 @@ fn address_of_reborrow() -> () {
153153
_9 = move _10 as *const dyn std::marker::Send (PointerCoercion(Unsize));
154154
StorageDead(_10);
155155
AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] });
156-
_8 = _9;
156+
_8 = copy _9;
157157
StorageDead(_9);
158158
StorageDead(_8);
159159
StorageLive(_11);
@@ -194,7 +194,7 @@ fn address_of_reborrow() -> () {
194194
StorageLive(_22);
195195
_22 = &raw const (*_3);
196196
AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] });
197-
_21 = _22;
197+
_21 = copy _22;
198198
StorageDead(_22);
199199
StorageDead(_21);
200200
StorageLive(_23);
@@ -207,7 +207,7 @@ fn address_of_reborrow() -> () {
207207
_25 = move _26 as *const dyn std::marker::Send (PointerCoercion(Unsize));
208208
StorageDead(_26);
209209
AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] });
210-
_24 = _25;
210+
_24 = copy _25;
211211
StorageDead(_25);
212212
StorageDead(_24);
213213
StorageLive(_27);
@@ -242,7 +242,7 @@ fn address_of_reborrow() -> () {
242242
StorageLive(_36);
243243
_36 = &raw mut (*_3);
244244
AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] });
245-
_35 = _36;
245+
_35 = copy _36;
246246
StorageDead(_36);
247247
StorageDead(_35);
248248
StorageLive(_37);
@@ -255,7 +255,7 @@ fn address_of_reborrow() -> () {
255255
_39 = move _40 as *mut dyn std::marker::Send (PointerCoercion(Unsize));
256256
StorageDead(_40);
257257
AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] });
258-
_38 = _39;
258+
_38 = copy _39;
259259
StorageDead(_39);
260260
StorageDead(_38);
261261
StorageLive(_41);

tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ fn main() -> () {
3333
StorageDead(_4);
3434
StorageLive(_5);
3535
StorageLive(_6);
36-
_6 = _3;
36+
_6 = copy _3;
3737
_5 = foo(move _6) -> [return: bb1, unwind unreachable];
3838
}
3939

4040
bb1: {
4141
StorageDead(_6);
4242
StorageLive(_7);
43-
_7 = _2;
43+
_7 = copy _2;
4444
_8 = Len(_1);
45-
_9 = Lt(_7, _8);
46-
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable];
45+
_9 = Lt(copy _7, copy _8);
46+
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable];
4747
}
4848

4949
bb2: {

tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ fn main() -> () {
3333
StorageDead(_4);
3434
StorageLive(_5);
3535
StorageLive(_6);
36-
_6 = _3;
36+
_6 = copy _3;
3737
_5 = foo(move _6) -> [return: bb1, unwind continue];
3838
}
3939

4040
bb1: {
4141
StorageDead(_6);
4242
StorageLive(_7);
43-
_7 = _2;
43+
_7 = copy _2;
4444
_8 = Len(_1);
45-
_9 = Lt(_7, _8);
46-
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue];
45+
_9 = Lt(copy _7, copy _8);
46+
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue];
4747
}
4848

4949
bb2: {

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yields ()
2222

2323
bb0: {
2424
StorageLive(_3);
25-
_3 = (_1.0: i32);
25+
_3 = copy (_1.0: i32);
2626
FakeRead(ForLet(None), _3);
2727
StorageLive(_4);
2828
_4 = &_3;

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yields ()
2222

2323
bb0: {
2424
StorageLive(_3);
25-
_3 = (_1.0: i32);
25+
_3 = copy (_1.0: i32);
2626
FakeRead(ForLet(None), _3);
2727
StorageLive(_4);
2828
_4 = &_3;

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yields ()
2222

2323
bb0: {
2424
StorageLive(_3);
25-
_3 = (_1.0: i32);
25+
_3 = copy (_1.0: i32);
2626
FakeRead(ForLet(None), _3);
2727
StorageLive(_4);
2828
_4 = &_3;

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yields ()
2222

2323
bb0: {
2424
StorageLive(_3);
25-
_3 = (_1.0: i32);
25+
_3 = copy (_1.0: i32);
2626
FakeRead(ForLet(None), _3);
2727
StorageLive(_4);
2828
_4 = &_3;

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r
44
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};
55

66
bb0: {
7-
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) };
7+
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
88
return;
99
}
1010
}

tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r
44
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};
55

66
bb0: {
7-
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) };
7+
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
88
return;
99
}
1010
}

tests/mir-opt/basic_assignment.main.ElaborateDrops.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
_1 = const false;
2828
StorageLive(_2);
2929
StorageLive(_3);
30-
_3 = _1;
30+
_3 = copy _1;
3131
_2 = move _3;
3232
StorageDead(_3);
3333
StorageLive(_4);

tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn main() -> () {
3131
FakeRead(ForLet(None), _1);
3232
StorageLive(_2);
3333
StorageLive(_3);
34-
_3 = _1;
34+
_3 = copy _1;
3535
_2 = move _3;
3636
StorageDead(_3);
3737
StorageLive(_4);

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
151151
StorageLive(_13);
152152
StorageLive(_14);
153153
StorageLive(_15);
154-
_15 = _38;
154+
_15 = copy _38;
155155
_14 = move _15;
156156
goto -> bb6;
157157
}
@@ -194,8 +194,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
194194

195195
bb10: {
196196
StorageLive(_17);
197-
_17 = ((_9 as Ready).0: ());
198-
_3 = _17;
197+
_17 = copy ((_9 as Ready).0: ());
198+
_3 = copy _17;
199199
StorageDead(_17);
200200
StorageDead(_14);
201201
StorageDead(_12);
@@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
253253
StorageLive(_29);
254254
StorageLive(_30);
255255
StorageLive(_31);
256-
_31 = _38;
256+
_31 = copy _38;
257257
_30 = move _31;
258258
goto -> bb18;
259259
}
@@ -291,8 +291,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
291291

292292
bb21: {
293293
StorageLive(_33);
294-
_33 = ((_25 as Ready).0: ());
295-
_37 = _33;
294+
_33 = copy ((_25 as Ready).0: ());
295+
_37 = copy _33;
296296
StorageDead(_33);
297297
StorageDead(_30);
298298
StorageDead(_28);

tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn adt() -> Onion {
99
bb0: {
1010
_1 = const 1_i32;
1111
_2 = Foo { a: const 1_i32, b: const 2_i32 };
12-
_3 = Bar::Foo(move _2, _1);
13-
_0 = Onion { neon: ((_3 as variant#0).1: i32) };
12+
_3 = Bar::Foo(move _2, copy _1);
13+
_0 = Onion { neon: copy ((_3 as variant#0).1: i32) };
1414
return;
1515
}
1616
}

tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn array() -> [i32; 2] {
88
bb0: {
99
_1 = [const 42_i32, const 43_i32];
1010
_2 = const 1_i32;
11-
_1 = [_2, const 2_i32];
11+
_1 = [copy _2, const 2_i32];
1212
_0 = move _1;
1313
return;
1414
}

tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ fn arbitrary_let(_1: i32) -> i32 {
66
let mut _3: i32;
77

88
bb0: {
9-
_2 = _1;
9+
_2 = copy _1;
1010
goto -> bb2;
1111
}
1212

1313
bb1: {
14-
_0 = _3;
14+
_0 = copy _3;
1515
return;
1616
}
1717

1818
bb2: {
19-
_3 = _2;
19+
_3 = copy _2;
2020
goto -> bb1;
2121
}
2222
}

tests/mir-opt/building/custom/arrays.arrays.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn arrays() -> usize {
88
bb0: {
99
_1 = [const 5_i32; C];
1010
_2 = Len(_1);
11-
_0 = _2;
11+
_0 = copy _2;
1212
return;
1313
}
1414
}

tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn float_to_int(_1: f32) -> i32 {
44
let mut _0: i32;
55

66
bb0: {
7-
_0 = _1 as i32 (FloatToInt);
7+
_0 = copy _1 as i32 (FloatToInt);
88
return;
99
}
1010
}

tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn int_to_int(_1: u32) -> i32 {
44
let mut _0: i32;
55

66
bb0: {
7-
_0 = _1 as i32 (IntToInt);
7+
_0 = copy _1 as i32 (IntToInt);
88
return;
99
}
1010
}

tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn int_to_ptr(_1: usize) -> *const i32 {
44
let mut _0: *const i32;
55

66
bb0: {
7-
_0 = _1 as *const i32 (PointerWithExposedProvenance);
7+
_0 = copy _1 as *const i32 (PointerWithExposedProvenance);
88
return;
99
}
1010
}

tests/mir-opt/building/custom/assume.assume_local.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn assume_local(_1: bool) -> () {
44
let mut _0: ();
55

66
bb0: {
7-
assume(_1);
7+
assume(copy _1);
88
return;
99
}
1010
}

tests/mir-opt/building/custom/assume.assume_place.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn assume_place(_1: (bool, u8)) -> () {
44
let mut _0: ();
55

66
bb0: {
7-
assume((_1.0: bool));
7+
assume(copy (_1.0: bool));
88
return;
99
}
1010
}

tests/mir-opt/building/custom/enums.switch_bool.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn switch_bool(_1: bool) -> u32 {
44
let mut _0: u32;
55

66
bb0: {
7-
switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2];
7+
switchInt(copy _1) -> [1: bb1, 0: bb2, otherwise: bb2];
88
}
99

1010
bb1: {

tests/mir-opt/building/custom/enums.switch_option.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn switch_option(_1: Option<()>) -> bool {
66

77
bb0: {
88
_2 = discriminant(_1);
9-
switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2];
9+
switchInt(copy _2) -> [0: bb1, 1: bb2, otherwise: bb2];
1010
}
1111

1212
bb1: {

tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn switch_option_repr(_1: Bool) -> bool {
66

77
bb0: {
88
_2 = discriminant(_1);
9-
switchInt(_2) -> [0: bb2, otherwise: bb1];
9+
switchInt(copy _2) -> [0: bb2, otherwise: bb1];
1010
}
1111

1212
bb1: {

tests/mir-opt/building/custom/operators.f.built.after.mir

+20-20
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ fn f(_1: i32, _2: bool) -> i32 {
55
let mut _3: (i32, bool);
66

77
bb0: {
8-
_1 = Neg(_1);
9-
_2 = Not(_2);
10-
_1 = Add(_1, _1);
11-
_1 = Sub(_1, _1);
12-
_1 = Mul(_1, _1);
13-
_1 = Div(_1, _1);
14-
_1 = Rem(_1, _1);
15-
_1 = BitXor(_1, _1);
16-
_1 = BitAnd(_1, _1);
17-
_1 = Shl(_1, _1);
18-
_1 = Shr(_1, _1);
19-
_2 = Eq(_1, _1);
20-
_2 = Lt(_1, _1);
21-
_2 = Le(_1, _1);
22-
_2 = Ge(_1, _1);
23-
_2 = Gt(_1, _1);
24-
_3 = AddWithOverflow(_1, _1);
25-
_2 = (_3.1: bool);
26-
_1 = (_3.0: i32);
27-
_0 = _1;
8+
_1 = Neg(copy _1);
9+
_2 = Not(copy _2);
10+
_1 = Add(copy _1, copy _1);
11+
_1 = Sub(copy _1, copy _1);
12+
_1 = Mul(copy _1, copy _1);
13+
_1 = Div(copy _1, copy _1);
14+
_1 = Rem(copy _1, copy _1);
15+
_1 = BitXor(copy _1, copy _1);
16+
_1 = BitAnd(copy _1, copy _1);
17+
_1 = Shl(copy _1, copy _1);
18+
_1 = Shr(copy _1, copy _1);
19+
_2 = Eq(copy _1, copy _1);
20+
_2 = Lt(copy _1, copy _1);
21+
_2 = Le(copy _1, copy _1);
22+
_2 = Ge(copy _1, copy _1);
23+
_2 = Gt(copy _1, copy _1);
24+
_3 = AddWithOverflow(copy _1, copy _1);
25+
_2 = copy (_3.1: bool);
26+
_1 = copy (_3.0: i32);
27+
_0 = copy _1;
2828
return;
2929
}
3030
}

tests/mir-opt/building/custom/operators.g.runtime.after.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ fn g(_1: *const i32, _2: *const [i32]) -> () {
66
let mut _4: usize;
77

88
bb0: {
9-
_3 = PtrMetadata(_1);
10-
_4 = PtrMetadata(_2);
9+
_3 = PtrMetadata(copy _1);
10+
_4 = PtrMetadata(copy _2);
1111
return;
1212
}
1313
}

tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn copy_for_deref(_1: (&i32, i32)) -> i32 {
66

77
bb0: {
88
_2 = deref_copy (_1.0: &i32);
9-
_0 = (*_2);
9+
_0 = copy (*_2);
1010
return;
1111
}
1212
}

0 commit comments

Comments
 (0)