rust/tests/ui/impl-trait/variance.rs
2023-08-28 01:05:34 +00:00

17 lines
415 B
Rust

#![feature(rustc_attrs)]
#![allow(internal_features)]
#![rustc_variance_of_opaques]
trait Captures<'a> {}
impl<T> Captures<'_> for T {}
fn not_captured_early<'a: 'a>() -> impl Sized {} //~ [*]
fn captured_early<'a: 'a>() -> impl Sized + Captures<'a> {} //~ [*, o]
fn not_captured_late<'a>(_: &'a ()) -> impl Sized {} //~ []
fn captured_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {} //~ [o]
fn main() {}