diff options
Diffstat (limited to 'tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-1.rs')
-rw-r--r-- | tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-1.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-1.rs b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-1.rs new file mode 100644 index 000000000..e6ffb55b4 --- /dev/null +++ b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-normalization-1.rs @@ -0,0 +1,22 @@ +// 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 `<LocalTy as Id>::Assoc: Copy` +// does not hold. +// +// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/51 +// for more details. +trait Trait {} +impl<T: Copy> Trait for T {} +struct LocalTy; +impl Trait for <LocalTy as Id>::Assoc {} + +fn main() {} |