mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
17 lines
353 B
Rust
17 lines
353 B
Rust
//@ check-pass
|
|
|
|
trait Captures<'a> {}
|
|
impl<T> Captures<'_> for T {}
|
|
|
|
trait Outlives<'a>: 'a {}
|
|
impl<'a, T: 'a> Outlives<'a> for T {}
|
|
|
|
// Test that we treat `for<'a> Opaque: 'a` as `Opaque: 'static`
|
|
fn test<'o>(v: &'o Vec<i32>) -> impl Captures<'o> + for<'a> Outlives<'a> {}
|
|
|
|
fn opaque_doesnt_use_temporary() {
|
|
let a = test(&vec![]);
|
|
}
|
|
|
|
fn main() {}
|