Skip to content

Commit fcf8468

Browse files
committed
add known-bug test for unsound issue 105782
1 parent 21b9f5c commit fcf8468

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// check-pass
2+
// known-bug: #105782
3+
4+
// Should fail. Default items completely drop candidates instead of ambiguity,
5+
// which is unsound during coherence, since coherence requires completeness.
6+
7+
#![feature(specialization)]
8+
#![allow(incomplete_features)]
9+
10+
trait Default {
11+
type Id;
12+
}
13+
14+
impl<T> Default for T {
15+
default type Id = T;
16+
}
17+
18+
trait Overlap {
19+
type Assoc;
20+
}
21+
22+
impl Overlap for u32 {
23+
type Assoc = usize;
24+
}
25+
26+
impl Overlap for <u32 as Default>::Id {
27+
type Assoc = Box<usize>;
28+
}
29+
30+
fn main() {}

0 commit comments

Comments
 (0)