mirror of https://github.com/rust-lang/rust.git
20 lines
389 B
Rust
20 lines
389 B
Rust
//@ check-pass
|
|
|
|
// Ensure that we skip uncaptured args from RPITITs when comptuing outlives.
|
|
|
|
#![feature(precise_capturing_in_traits)]
|
|
|
|
struct Invariant<T>(*mut T);
|
|
|
|
trait Foo {
|
|
fn hello<'s: 's>(&'s self) -> Invariant<impl Sized + use<Self>>;
|
|
}
|
|
|
|
fn outlives_static(_: impl Sized + 'static) {}
|
|
|
|
fn hello<'s, T: Foo + 'static>(x: &'s T) {
|
|
outlives_static(x.hello());
|
|
}
|
|
|
|
fn main() {}
|