rust/tests/ui/async-await/pin-reborrow-shorter.rs
Eric Holk b2b76fb706
Allow shortening reborrows
Generating a call to `as_mut()` let to more restrictive borrows than
what reborrowing usually gives us. Instead, we change the desugaring to
reborrow the pin internals directly which makes things more expressive.
2024-09-19 15:34:00 -07:00

15 lines
237 B
Rust

//@check-pass
#![feature(pin_ergonomics)]
#![allow(dead_code, incomplete_features)]
use std::pin::Pin;
fn shorter<'b, T: 'b>(_: Pin<&'b mut T>) {}
fn test<'a: 'b, 'b, T: 'a>(x: Pin<&'a mut T>) {
shorter::<'b>(x);
}
fn main() {}