mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 05:27:36 +00:00
21 lines
300 B
Rust
21 lines
300 B
Rust
![]() |
// check-pass
|
||
|
|
||
|
#![feature(return_position_impl_trait_in_trait)]
|
||
|
#![allow(incomplete_features)]
|
||
|
|
||
|
use std::fmt::Display;
|
||
|
|
||
|
trait Foo {
|
||
|
fn bar(&self) -> impl Display;
|
||
|
}
|
||
|
|
||
|
impl Foo for () {
|
||
|
fn bar(&self) -> impl Display {
|
||
|
"Hello, world"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
println!("{}", ().bar());
|
||
|
}
|