blob: 241efadef7d577dad53ce68cc68f0846ac83f8fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#![feature(pin_ergonomics)]
#![allow(dead_code, incomplete_features)]
// Make sure with pin reborrowing that we can only get one mutable reborrow of a pinned reference.
use std::pin::{pin, Pin};
fn twice(_: Pin<&mut i32>, _: Pin<&mut i32>) {}
fn main() {
let x = pin!(42);
twice(x, x); //~ ERROR cannot borrow
}
|