]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / type-alias-impl-trait / imply_bounds_from_bounds.rs
1 // check-pass
2
3 #![feature(type_alias_impl_trait)]
4
5 trait Callable {
6     type Output;
7     fn call() -> Self::Output;
8 }
9
10 impl<'a> Callable for &'a () {
11     type Output = impl Sized;
12     fn call() -> Self::Output {}
13 }
14
15 fn test<'a>() -> impl Sized {
16     <&'a () as Callable>::call()
17 }
18
19 fn want_static<T: 'static>(_: T) {}
20
21 fn test2<'a>() {
22     want_static(<&'a () as Callable>::call());
23 }
24
25 fn main() {}