fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.0 KiB87 linesraw
1// MIR for `main` after built
2
3| User Type Annotations
4| 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
5| 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
6| 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
7| 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
8|
9fn main() -> () {
10    let mut _0: ();
11    let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] };
12    let _2: ();
13    let mut _3: *const Test;
14    let mut _4: *mut Test;
15    let _6: &&&&*mut Test;
16    let _7: &&&*mut Test;
17    let _8: &&*mut Test;
18    let _9: &*mut Test;
19    let _10: ();
20    let mut _11: *const Test;
21    let mut _12: *mut Test;
22    scope 1 {
23        debug ptr => _1;
24        let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] };
25        scope 2 {
26            debug ptr_ref => _5;
27        }
28    }
29
30    bb0: {
31        StorageLive(_1);
32        _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4];
33    }
34
35    bb1: {
36        FakeRead(ForLet(None), _1);
37        AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
38        StorageLive(_2);
39        StorageLive(_3);
40        StorageLive(_4);
41        _4 = _1;
42        _3 = move _4 as *const Test (PointerCoercion(MutToConstPointer));
43        StorageDead(_4);
44        _2 = Test::x(move _3) -> [return: bb2, unwind: bb4];
45    }
46
47    bb2: {
48        StorageDead(_3);
49        StorageDead(_2);
50        StorageLive(_5);
51        StorageLive(_6);
52        StorageLive(_7);
53        StorageLive(_8);
54        StorageLive(_9);
55        _9 = &_1;
56        _8 = &_9;
57        _7 = &_8;
58        _6 = &_7;
59        _5 = &(*_6);
60        FakeRead(ForLet(None), _5);
61        AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] });
62        StorageDead(_6);
63        StorageLive(_10);
64        StorageLive(_11);
65        StorageLive(_12);
66        _12 = (*(*(*(*_5))));
67        _11 = move _12 as *const Test (PointerCoercion(MutToConstPointer));
68        StorageDead(_12);
69        _10 = Test::x(move _11) -> [return: bb3, unwind: bb4];
70    }
71
72    bb3: {
73        StorageDead(_11);
74        StorageDead(_10);
75        _0 = const ();
76        StorageDead(_9);
77        StorageDead(_8);
78        StorageDead(_7);
79        StorageDead(_5);
80        StorageDead(_1);
81        return;
82    }
83
84    bb4 (cleanup): {
85        resume;
86    }
87}