blob: ee9bce15d3478e2e73c5b266a7d983f01383c5db (
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(type_alias_impl_trait)]
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() {}
|