summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs
blob: 4f99236f4eab358b89f72c200c7489fc1a18a106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// check-pass

#![feature(impl_trait_in_assoc_type)]

trait Callable {
    type Output;
    fn call() -> Self::Output;
}

impl<'a> Callable for &'a () {
    type Output = impl Sized;
    fn call() -> Self::Output {}
}

fn test<'a>() -> impl Sized {
    <&'a () as Callable>::call()
}

fn want_static<T: 'static>(_: T) {}

fn test2<'a>() {
    want_static(<&'a () as Callable>::call());
}

fn main() {}