]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / type-alias-impl-trait / implied_lifetime_wf_check4_static.rs
1 #![feature(type_alias_impl_trait)]
2
3 mod test_type_param_static {
4     type Ty<A> = impl Sized + 'static;
5     //~^ ERROR: the parameter type `A` may not live long enough
6     fn defining<A: 'static>(s: A) -> Ty<A> { s }
7     fn assert_static<A: 'static>() {}
8     fn test<A>() where Ty<A>: 'static { assert_static::<A>() }
9 }
10
11 fn main() {}