about summary refs log tree commit diff
path: root/src/test/ui/issues/issue-47722.rs
blob: c9bc6147aa9ca421e39a46e4d41e0897059a5659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// compile-pass
#![allow(dead_code)]

// Tests that automatic coercions from &mut T to *mut T
// allow borrows of T to expire immediately - essentially, that
// they work identically to 'foo as *mut T'
#![feature(nll)]

struct SelfReference {
    self_reference: *mut SelfReference,
}

impl SelfReference {
    fn set_self_ref(&mut self) {
        self.self_reference = self;
    }
}

fn main() {}