2024-02-16 14:02:50 -06:00
|
|
|
//@ revisions: classic coherence next
|
|
|
|
//@[next] compile-flags: -Znext-solver
|
|
|
|
//@[coherence] compile-flags: -Znext-solver=coherence
|
|
|
|
//@[classic] check-pass
|
|
|
|
//@[classic] known-bug: #105782
|
2023-04-26 20:47:31 -05:00
|
|
|
|
|
|
|
// Should fail. Default items completely drop candidates instead of ambiguity,
|
|
|
|
// which is unsound during coherence, since coherence requires completeness.
|
|
|
|
|
|
|
|
#![feature(specialization)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
trait Default {
|
2024-02-02 02:36:46 -06:00
|
|
|
type Id;
|
2023-04-26 20:47:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Default for T {
|
2024-02-02 02:36:46 -06:00
|
|
|
default type Id = T; //[next]~ ERROR type annotations needed
|
2023-04-26 20:47:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Overlap {
|
2024-02-02 02:36:46 -06:00
|
|
|
type Assoc;
|
2023-04-26 20:47:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Overlap for u32 {
|
2024-02-02 02:36:46 -06:00
|
|
|
type Assoc = usize;
|
2023-04-26 20:47:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Overlap for <u32 as Default>::Id {
|
2024-02-02 02:36:46 -06:00
|
|
|
//[coherence]~^ ERROR conflicting implementations of trait `Overlap` for type `u32`
|
|
|
|
//[next]~^^ ERROR conflicting implementations of trait `Overlap` for type `u32`
|
|
|
|
type Assoc = Box<usize>;
|
2023-04-26 20:47:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|