about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs
blob: 4874e2e1f99c523659e4a4bd266cf5410c0908dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//@ check-pass
//@ revisions: ai ia ii

// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>.

#![feature(lazy_type_alias)]
#![feature(rustc_attrs)]
#![rustc_no_implicit_bounds]
#![allow(incomplete_features)]

type Id<T> = T;
trait NotImplemented {}

struct W<T, U>(*const T, *const U);
trait Trait {
    type Assoc;
}
impl<T: Trait> Trait for W<T, T> {
    #[cfg(ai)]
    type Assoc = W<T::Assoc, Id<T::Assoc>>;
    #[cfg(ia)]
    type Assoc = W<Id<T::Assoc>, T::Assoc>;
    #[cfg(ii)]
    type Assoc = W<Id<T::Assoc>, Id<T::Assoc>>;
}

trait Overlap<T> {}
impl<T> Overlap<T> for W<T, T> {}
impl<T: Trait + NotImplemented> Overlap<T::Assoc> for T {}

fn main() {}