diff options
Diffstat (limited to 'tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-normalization-3.rs')
-rw-r--r-- | tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-normalization-3.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-normalization-3.rs b/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-normalization-3.rs new file mode 100644 index 000000000..2f27de4e4 --- /dev/null +++ b/tests/ui/traits/new-solver/coherence/trait_ref_is_knowable-normalization-3.rs @@ -0,0 +1,24 @@ +// compile-flags: -Ztrait-solver=next +// 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() {} |