summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs')
-rw-r--r--tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs b/tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs
new file mode 100644
index 000000000..bdf999ec5
--- /dev/null
+++ b/tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs
@@ -0,0 +1,25 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Foo {
+ type Assoc;
+}
+
+trait Bar {}
+
+impl<T> Foo for T {
+ type Assoc = i32;
+}
+
+impl<T> Bar for T where T: Foo<Assoc = i32> {}
+
+fn require_bar<T: Bar>() {}
+
+fn foo<T: Foo>() {
+ // Unlike the classic solver, `<T as Foo>::Assoc = _` will still project
+ // down to `i32` even though there's a param-env candidate here, since we
+ // don't assemble any param-env projection candidates for `T: Foo` alone.
+ require_bar::<T>();
+}
+
+fn main() {}