summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
blob: fed5e68c3c97dd6678f12be2847eb3f1d37f2c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// MIR for `main` after built

| User Type Annotations
| 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
|
fn main() -> () {
    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;
    scope 1 {
        debug ptr => _1;
        let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] };
        scope 2 {
            debug ptr_ref => _5;
        }
    }

    bb0: {
        StorageLive(_1);
        _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4];
    }

    bb1: {
        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 (PointerCoercion(MutToConstPointer));
        StorageDead(_4);
        _2 = Test::x(move _3) -> [return: bb2, unwind: bb4];
    }

    bb2: {
        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 (PointerCoercion(MutToConstPointer));
        StorageDead(_12);
        _10 = Test::x(move _11) -> [return: bb3, unwind: bb4];
    }

    bb3: {
        StorageDead(_11);
        StorageDead(_10);
        _0 = const ();
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_7);
        StorageDead(_5);
        StorageDead(_1);
        return;
    }

    bb4 (cleanup): {
        resume;
    }
}