mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
18 lines
359 B
Rust
18 lines
359 B
Rust
//@ check-pass
|
|
|
|
// 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() {}
|