rust/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs

17 lines
343 B
Rust
Raw Normal View History

// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next
2022-08-31 04:46:54 +00:00
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
trait Foo {
fn bar() -> impl std::fmt::Display;
}
impl Foo for () {
fn bar() -> () {}
//~^ ERROR `()` doesn't implement `std::fmt::Display`
}
fn main() {}