blob: 06c119287d745507da5d8af8b9c764874f025b31 (
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
26
27
28
29
|
// check-pass
#![feature(impl_trait_in_assoc_type, type_alias_impl_trait)]
mod foo {
pub trait Callable {
type Output;
fn call() -> Self::Output;
}
pub type OutputHelper = impl Sized;
impl<'a> Callable for &'a () {
type Output = OutputHelper;
fn call() -> Self::Output {}
}
}
use foo::*;
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() {}
|