mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
21 lines
378 B
Rust
21 lines
378 B
Rust
// 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();
|
|
}
|