summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs')
-rw-r--r--tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs
new file mode 100644
index 000000000..90de6b847
--- /dev/null
+++ b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-3.rs
@@ -0,0 +1,24 @@
+// compile-flags: -Znext-solver
+// check-pass
+
+trait Id {
+ type Assoc;
+}
+impl<T> Id for T {
+ type Assoc = T;
+}
+
+
+// Coherence should be able to reason that `(): PartialEq<<T as Id>::Assoc>>`
+// does not hold.
+//
+// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/51
+// for more details.
+trait Trait {}
+impl<T> Trait for T
+where
+ (): PartialEq<T> {}
+struct LocalTy;
+impl Trait for <LocalTy as Id>::Assoc {}
+
+fn main() {}