2023-03-08 08:18:38 -06:00
|
|
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
|
|
|
// revisions: current next
|
|
|
|
|
2022-08-30 23:46:54 -05:00
|
|
|
#![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() {
|
|
|
|
let x: &str = ().bar();
|
|
|
|
//~^ ERROR mismatched types
|
|
|
|
}
|