7b7992fbcf
This commit adds basic support for reborrowing `Pin` types in argument position. At the moment it only supports reborrowing `Pin<&mut T>` as `Pin<&mut T>` by inserting a call to `Pin::as_mut()`, and only in argument position (not as the receiver in a method call).
15 lines
211 B
Rust
15 lines
211 B
Rust
#![allow(dead_code, incomplete_features)]
|
|
|
|
use std::pin::Pin;
|
|
|
|
struct Foo;
|
|
|
|
fn foo(_: Pin<&mut Foo>) {
|
|
}
|
|
|
|
fn bar(mut x: Pin<&mut Foo>) {
|
|
foo(x);
|
|
foo(x); //~ ERROR use of moved value: `x`
|
|
}
|
|
|
|
fn main() {}
|