rust/tests/ui/moves/pin-mut-reborrow.rs
2024-02-16 20:02:50 +00:00

16 lines
233 B
Rust

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