rust/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs
Eric Holk 7b7992fbcf
Begin experimental support for pin reborrowing
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).
2024-09-18 12:36:31 -07:00

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() {}