//! This test shows how we fail selection in a way that can influence //! selection in a code path that succeeds. //@ revisions: next old //@[next] compile-flags: -Znext-solver fn is_trait, U: Default>(_: T) -> U { Default::default() } trait Trait {} impl Trait for T {} impl Trait for T {} fn foo() -> impl Sized { if false { is_trait(foo()) } else { Default::default() } //~^ ERROR: type annotations needed } fn main() {}