summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/reveal.rs
blob: 1f42ec744dbe8031a1e3d4c38de3dae8fd036169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// check-pass
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next

#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

trait Foo {
    fn f() -> Box<impl Sized>;
}

impl Foo for () {
    fn f() -> Box<String> {
        Box::new(String::new())
    }
}

fn main() {
    let x: Box<String> = <() as Foo>::f();
}