summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/variance.rs
blob: d6212f8f393727632335eeac48e3e73a29eec050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![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() {}