]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-47722.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[rust.git] / src / test / ui / issues / issue-47722.rs
1 // check-pass
2
3 // Tests that automatic coercions from &mut T to *mut T
4 // allow borrows of T to expire immediately - essentially, that
5 // they work identically to 'foo as *mut T'
6
7 struct SelfReference {
8     self_reference: *mut SelfReference,
9 }
10
11 impl SelfReference {
12     fn set_self_ref(&mut self) {
13         self.self_reference = self;
14     }
15 }
16
17 fn main() {}