//@ compile-flags: -Znext-solver //@ ignore-compare-mode-next-solver (explicit revisions) #![allow(unconditional_recursion)] // Regression test for trait-system-refactor-initiative#205. Avoid // constraining other impl arguments when applying blanket impls, // especially if the nested where-bounds of the blanket impl don't // actually apply for the opaque. // FIXME(-Znext-solver): This currently incompletely constrains the // argument of `opaque: Trait` using the blanket impl of trait. // Ideally we don't do that. trait Trait {} impl Trait for T {} impl Trait for String {} fn impls_trait, U>(_: T) {} fn test() -> impl Sized { let x = test(); impls_trait(x); //~ ERROR the trait bound `String: Trait` is not satisfied String::new() } fn main() {}