1
Fork 0
rust/tests/ui/impl-trait/in-trait/variance.rs

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

23 lines
613 B
Rust
Raw Normal View History

2023-09-13 16:04:42 +00:00
#![feature(rustc_attrs)]
2023-08-08 19:59:44 +00:00
#![allow(internal_features)]
#![rustc_variance_of_opaques]
trait Captures<'a> {}
impl<T> Captures<'_> for T {}
trait Foo<'i> {
fn implicit_capture_early<'a: 'a>() -> impl Sized {}
//~^ [Self: o, 'i: *, 'a: *, 'a: o, 'i: o]
2023-08-08 19:59:44 +00:00
fn explicit_capture_early<'a: 'a>() -> impl Sized + Captures<'a> {}
//~^ [Self: o, 'i: *, 'a: *, 'a: o, 'i: o]
2023-08-08 19:59:44 +00:00
fn implicit_capture_late<'a>(_: &'a ()) -> impl Sized {}
//~^ [Self: o, 'i: *, 'a: o, 'i: o]
2023-08-08 19:59:44 +00:00
fn explicit_capture_late<'a>(_: &'a ()) -> impl Sized + Captures<'a> {}
//~^ [Self: o, 'i: *, 'a: o, 'i: o]
2023-08-08 19:59:44 +00:00
}
fn main() {}