]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/receiver-ptr-mutability.rs
Rollup merge of #101772 - est31:replace_placeholder_diagnostics, r=jackh726
[rust.git] / src / test / mir-opt / receiver-ptr-mutability.rs
1 // EMIT_MIR receiver_ptr_mutability.main.mir_map.0.mir
2
3 #![feature(arbitrary_self_types)]
4
5 struct Test {}
6
7 impl Test {
8     fn x(self: *const Self) {
9         println!("x called");
10     }
11 }
12
13 fn main() {
14     let ptr: *mut Test = std::ptr::null_mut();
15     ptr.x();
16
17     // Test autoderefs
18     let ptr_ref: &&&&*mut Test = &&&&ptr;
19     ptr_ref.x();
20 }