2022-09-04 22:00:31 -05:00
|
|
|
// MIR for `main` after built
|
2021-03-09 04:36:12 -06:00
|
|
|
|
|
|
|
| User Type Annotations
|
2023-03-25 15:10:41 -05:00
|
|
|
| 0: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
|
|
|
|
| 1: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
|
|
|
|
| 2: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
|
|
|
|
| 3: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
|
2021-03-09 04:36:12 -06:00
|
|
|
|
|
|
|
|
fn main() -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: ();
|
|
|
|
let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] };
|
|
|
|
let _2: ();
|
|
|
|
let mut _3: *const Test;
|
|
|
|
let mut _4: *mut Test;
|
|
|
|
let _6: &&&&*mut Test;
|
|
|
|
let _7: &&&*mut Test;
|
|
|
|
let _8: &&*mut Test;
|
|
|
|
let _9: &*mut Test;
|
|
|
|
let _10: ();
|
|
|
|
let mut _11: *const Test;
|
|
|
|
let mut _12: *mut Test;
|
2021-03-09 04:36:12 -06:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug ptr => _1;
|
|
|
|
let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] };
|
2021-03-09 04:36:12 -06:00
|
|
|
scope 2 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug ptr_ref => _5;
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_1);
|
|
|
|
_1 = null_mut::<Test>() -> [return: bb1, unwind: bb4];
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
FakeRead(ForLet(None), _1);
|
|
|
|
AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
|
|
|
|
StorageLive(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
_4 = _1;
|
|
|
|
_3 = move _4 as *const Test (Pointer(MutToConstPointer));
|
|
|
|
StorageDead(_4);
|
|
|
|
_2 = Test::x(move _3) -> [return: bb2, unwind: bb4];
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_3);
|
|
|
|
StorageDead(_2);
|
|
|
|
StorageLive(_5);
|
|
|
|
StorageLive(_6);
|
|
|
|
StorageLive(_7);
|
|
|
|
StorageLive(_8);
|
|
|
|
StorageLive(_9);
|
|
|
|
_9 = &_1;
|
|
|
|
_8 = &_9;
|
|
|
|
_7 = &_8;
|
|
|
|
_6 = &_7;
|
|
|
|
_5 = &(*_6);
|
|
|
|
FakeRead(ForLet(None), _5);
|
|
|
|
AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] });
|
|
|
|
StorageDead(_6);
|
|
|
|
StorageLive(_10);
|
|
|
|
StorageLive(_11);
|
|
|
|
StorageLive(_12);
|
|
|
|
_12 = (*(*(*(*_5))));
|
|
|
|
_11 = move _12 as *const Test (Pointer(MutToConstPointer));
|
|
|
|
StorageDead(_12);
|
|
|
|
_10 = Test::x(move _11) -> [return: bb3, unwind: bb4];
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_11);
|
|
|
|
StorageDead(_10);
|
|
|
|
_0 = const ();
|
|
|
|
StorageDead(_9);
|
|
|
|
StorageDead(_8);
|
|
|
|
StorageDead(_7);
|
|
|
|
StorageDead(_5);
|
|
|
|
StorageDead(_1);
|
|
|
|
return;
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4 (cleanup): {
|
2023-06-06 08:47:00 -05:00
|
|
|
resume;
|
2021-03-09 04:36:12 -06:00
|
|
|
}
|
|
|
|
}
|