rust/tests/ui/impl-trait/variance.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
415 B
Rust
Raw Normal View History

2023-08-08 14:59:44 -05:00
#![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() {}