mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
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).
16 lines
211 B
Rust
16 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() {}
|