]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/issue-75899-but-gats.rs
internally change regions to be covariant
[rust.git] / tests / ui / unsized / issue-75899-but-gats.rs
1 // check-pass
2
3 use std::fmt::Debug;
4 use std::marker::PhantomData;
5
6 trait Foo {
7     type Gat<'a>: ?Sized where Self: 'a;
8 }
9
10 struct Bar<'a, T: Foo + 'a>(T::Gat<'a>);
11
12 struct Baz<T: ?Sized>(PhantomData<T>);
13
14 impl<T: ?Sized> Foo for Baz<T> {
15     type Gat<'a> = T where Self: 'a;
16 }
17
18 fn main() {
19     let x = Bar::<'_, Baz<()>>(());
20     let y: &Bar<'_, Baz<dyn Debug>> = &x;
21 }