diff --git a/tests/ui/traits/next-solver/assembly/param-env-alias-bound-conflict.rs b/tests/ui/traits/next-solver/assembly/param-env-alias-bound-conflict.rs new file mode 100644 index 00000000000..ddda1a71d7e --- /dev/null +++ b/tests/ui/traits/next-solver/assembly/param-env-alias-bound-conflict.rs @@ -0,0 +1,26 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +// Regression test for #119607. + +pub trait IntoFoo { + type Item; + type IntoIter: Foo; + + fn into_iter(self) -> Self::IntoIter; +} + +pub trait Foo { + type Item; + + fn next(self) -> Option; +} + +pub fn foo<'a, Iter1, Elem1>(a: &'a Iter1) +where + &'a Iter1: IntoFoo, +{ + a.into_iter().next(); +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs b/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs new file mode 100644 index 00000000000..1b9e9866cd6 --- /dev/null +++ b/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs @@ -0,0 +1,23 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +// Regression test for #119608. + +pub trait Foo {} + +pub trait Bar { + type Assoc; +} + +impl Bar for T { + type Assoc = T; +} + +pub fn foo(_input: ::Assoc) +where + I: Bar, + ::Assoc: Foo, +{ +} + +fn main() {}