diff options
Diffstat (limited to 'tests/ui/issues/issue-47722.rs')
-rw-r--r-- | tests/ui/issues/issue-47722.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-47722.rs b/tests/ui/issues/issue-47722.rs new file mode 100644 index 000000000..5645a6343 --- /dev/null +++ b/tests/ui/issues/issue-47722.rs @@ -0,0 +1,17 @@ +// 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() {} |