mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
19 lines
329 B
Rust
19 lines
329 B
Rust
#![feature(pin_ergonomics)]
|
|
#![allow(dead_code, incomplete_features)]
|
|
|
|
// make sure we can't accidentally reborrow Pin<&T> as Pin<&mut T>
|
|
|
|
use std::pin::Pin;
|
|
|
|
struct Foo;
|
|
|
|
fn foo(_: Pin<&mut Foo>) {
|
|
}
|
|
|
|
fn bar(x: Pin<&Foo>) {
|
|
foo(x); //~ ERROR mismatched types
|
|
//| ERROR types differ in mutability
|
|
}
|
|
|
|
fn main() {}
|