rust/tests/ui/moves/pin-mut-reborrow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
232 B
Rust
Raw Normal View History

// 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
}