summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/reveal.rs
blob: b1b46d75b8f370dd1b6910e73d3e321a59a317c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check-pass

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

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

impl Foo for () {
    #[expect(refining_impl_trait)]
    fn f() -> Box<String> {
        Box::new(String::new())
    }
}

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