Skip to content

Commit aabdeed

Browse files
bless coherence test
1 parent 3d4da98 commit aabdeed

3 files changed

+31
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
2+
--> $DIR/specialization-default-items-drop-coherence.rs:29:1
3+
|
4+
LL | impl Overlap for u32 {
5+
| -------------------- first implementation here
6+
...
7+
LL | impl Overlap for <u32 as Default>::Id {
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0119`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
2+
--> $DIR/specialization-default-items-drop-coherence.rs:29:1
3+
|
4+
LL | impl Overlap for u32 {
5+
| -------------------- first implementation here
6+
...
7+
LL | impl Overlap for <u32 as Default>::Id {
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0119`.

tests/ui/specialization/specialization-default-items-drop-coherence.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
// check-pass
2-
// known-bug: #105782
1+
// revisions: classic coherence next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
//[coherence] compile-flags: -Ztrait-solver=next-coherence
4+
//[classic] check-pass
5+
//[classic] known-bug: #105782
36

47
// Should fail. Default items completely drop candidates instead of ambiguity,
58
// which is unsound during coherence, since coherence requires completeness.
@@ -24,6 +27,8 @@ impl Overlap for u32 {
2427
}
2528

2629
impl Overlap for <u32 as Default>::Id {
30+
//[coherence]~^ ERROR conflicting implementations of trait `Overlap` for type `u32`
31+
//[next]~^^ ERROR conflicting implementations of trait `Overlap` for type `u32`
2732
type Assoc = Box<usize>;
2833
}
2934

0 commit comments

Comments
 (0)