//! This test checks that we don't follow up //! with type mismatch errors of opaque types //! with their hidden types if we failed the //! defining scope check at the signature level. #![feature(impl_trait_in_assoc_type)] trait Foo { type Bar; fn foo() -> Self::Bar; fn bar() -> Self::Bar; } impl Foo for () { type Bar = impl Sized; fn foo() -> Self::Bar {} //~^ ERROR non-defining opaque type use fn bar() -> Self::Bar {} } fn main() {}