2024-09-20 19:09:18 +00:00
|
|
|
#![allow(dead_code)]
|
2024-09-04 23:03:47 +00:00
|
|
|
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
2024-09-20 02:35:01 +00:00
|
|
|
impl Foo {
|
|
|
|
fn foo(self: Pin<&mut Self>) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-20 19:09:18 +00:00
|
|
|
fn foo(x: Pin<&mut Foo>) {
|
|
|
|
let _y: &pin mut Foo = x; //~ ERROR pinned reference syntax is experimental
|
2024-09-04 23:03:47 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 19:09:18 +00:00
|
|
|
fn foo_sugar(_: &pin mut Foo) {} //~ ERROR pinned reference syntax is experimental
|
|
|
|
|
|
|
|
fn bar(x: Pin<&mut Foo>) {
|
2024-09-04 23:03:47 +00:00
|
|
|
foo(x);
|
|
|
|
foo(x); //~ ERROR use of moved value: `x`
|
2024-10-01 19:44:10 +00:00
|
|
|
}
|
2024-09-20 02:35:01 +00:00
|
|
|
|
2024-10-01 19:44:10 +00:00
|
|
|
fn baz(mut x: Pin<&mut Foo>) {
|
|
|
|
x.foo();
|
2024-09-20 02:35:01 +00:00
|
|
|
x.foo(); //~ ERROR use of moved value: `x`
|
2024-09-04 23:03:47 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 19:09:18 +00:00
|
|
|
fn baz_sugar(_: &pin const Foo) {} //~ ERROR pinned reference syntax is experimental
|
|
|
|
|
2024-09-04 23:03:47 +00:00
|
|
|
fn main() {}
|