rust/tests/ui/async-await/pin-reborrow-const-as-mut.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
329 B
Rust
Raw Normal View History

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