blob: c32174288ee684069c391825a168785e6c0d8aef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// check-pass
#![feature(type_alias_impl_trait)]
mod foo {
type Ty<'a> = impl Sized;
fn defining(s: &str) -> Ty<'_> { s }
fn execute(ty: Ty<'_>) -> &str { todo!() }
}
mod bar {
type Ty<'a> = impl FnOnce() -> &'a str;
fn defining(s: &str) -> Ty<'_> { move || s }
fn execute(ty: Ty<'_>) -> &str { ty() }
}
fn main() {}
|