mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
16 lines
242 B
Rust
16 lines
242 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.as_mut().foo();
|
||
|
foo.foo(); //~ ERROR use of moved value
|
||
|
}
|