2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2018-08-30 07:18:55 -05:00
|
|
|
|
2018-01-29 22:15:38 -06:00
|
|
|
// 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'
|
|
|
|
|
|
|
|
struct SelfReference {
|
|
|
|
self_reference: *mut SelfReference,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SelfReference {
|
|
|
|
fn set_self_ref(&mut self) {
|
|
|
|
self.self_reference = self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|