diff options
Diffstat (limited to 'tests/ui/moves/pin-mut-reborrow.fixed')
-rw-r--r-- | tests/ui/moves/pin-mut-reborrow.fixed | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/moves/pin-mut-reborrow.fixed b/tests/ui/moves/pin-mut-reborrow.fixed new file mode 100644 index 000000000..e808186d7 --- /dev/null +++ b/tests/ui/moves/pin-mut-reborrow.fixed @@ -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.as_mut().foo(); + foo.foo(); //~ ERROR use of moved value +} |