diff options
Diffstat (limited to 'tests/ui/moves/pin-mut-reborrow.rs')
-rw-r--r-- | tests/ui/moves/pin-mut-reborrow.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/moves/pin-mut-reborrow.rs b/tests/ui/moves/pin-mut-reborrow.rs new file mode 100644 index 000000000..fee6236eb --- /dev/null +++ b/tests/ui/moves/pin-mut-reborrow.rs @@ -0,0 +1,15 @@ +// run-rustfix +use std::pin::Pin; + +struct Foo; + +impl Foo { + fn foo(self: Pin<&mut Self>) {} +} + +fn main() { + let mut foo = Foo; + let mut foo = Pin::new(&mut foo); + foo.foo(); + foo.foo(); //~ ERROR use of moved value +} |