about summary refs log tree commit diff
path: root/tests/ui/specialization/overlap-due-to-unsatisfied-const-bound.rs
blob: f4cde1d62b2c9141ba63c1627f1b98161a973a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Regression test for #140571. The compiler used to ICE

#![feature(associated_const_equality, specialization)]
//~^ WARN the feature `specialization` is incomplete

pub trait IsVoid {
    const IS_VOID: bool;
}
impl<T> IsVoid for T {
    default const IS_VOID: bool = false;
}

pub trait NotVoid {}
impl<T> NotVoid for T where T: IsVoid<IS_VOID = false> + ?Sized {}

pub trait Maybe<T> {}
impl<T> Maybe<T> for T {}
impl<T> Maybe<T> for () where T: NotVoid + ?Sized {}
//~^ ERROR conflicting implementations of trait `Maybe<()>` for type `()`

fn main() {}