rust/tests/ui/impl-trait/in-trait/reveal.rs
2023-01-11 09:32:08 +00:00

19 lines
286 B
Rust

// check-pass
#![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();
}