mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
21 lines
443 B
Rust
21 lines
443 B
Rust
//@ compile-flags: -Znext-solver=coherence
|
|
//@ check-pass
|
|
|
|
trait Mirror {
|
|
type Assoc;
|
|
}
|
|
impl<T> Mirror for T {
|
|
type Assoc = T;
|
|
}
|
|
|
|
trait Foo {}
|
|
trait Bar {}
|
|
|
|
// self type starts out as `?0` but is constrained to `()`
|
|
// due to the where clause below. Because `(): Bar` does not
|
|
// hold in intercrate mode, we can prove the impls disjoint.
|
|
impl<T> Foo for T where (): Mirror<Assoc = T> {}
|
|
impl<T> Foo for T where T: Bar {}
|
|
|
|
fn main() {}
|