summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/receiver-ptr-mutability.rs
blob: 8e2ff0451c63e991020570e28dba08cc86cb9438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// EMIT_MIR receiver_ptr_mutability.main.mir_map.0.mir

#![feature(arbitrary_self_types)]

struct Test {}

impl Test {
    fn x(self: *const Self) {
        println!("x called");
    }
}

fn main() {
    let ptr: *mut Test = std::ptr::null_mut();
    ptr.x();

    // Test autoderefs
    let ptr_ref: &&&&*mut Test = &&&&ptr;
    ptr_ref.x();
}