]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / type-alias-impl-trait / associated-type-impl-trait-lifetime.rs
1 //check-pass
2
3 #![feature(type_alias_impl_trait)]
4
5 trait Trait {
6     type Opaque1;
7     type Opaque2;
8     fn constrain(self);
9 }
10
11 impl<'a> Trait for &'a () {
12     type Opaque1 = impl Sized;
13     type Opaque2 = impl Sized + 'a;
14     fn constrain(self) {
15         let _: Self::Opaque1 = ();
16         let _: Self::Opaque2 = self;
17     }
18 }
19
20 fn main() {}