bless coherence test

This commit is contained in:
Michael Goulet 2023-05-31 01:39:20 +00:00
parent 3d4da98273
commit aabdeedc7c
3 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,12 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
--> $DIR/specialization-default-items-drop-coherence.rs:29:1
|
LL | impl Overlap for u32 {
| -------------------- first implementation here
...
LL | impl Overlap for <u32 as Default>::Id {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.

View File

@ -0,0 +1,12 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
--> $DIR/specialization-default-items-drop-coherence.rs:29:1
|
LL | impl Overlap for u32 {
| -------------------- first implementation here
...
LL | impl Overlap for <u32 as Default>::Id {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.

View File

@ -1,5 +1,8 @@
// check-pass
// known-bug: #105782
// revisions: classic coherence next
//[next] compile-flags: -Ztrait-solver=next
//[coherence] compile-flags: -Ztrait-solver=next-coherence
//[classic] check-pass
//[classic] known-bug: #105782
// Should fail. Default items completely drop candidates instead of ambiguity,
// which is unsound during coherence, since coherence requires completeness.
@ -24,6 +27,8 @@ impl Overlap for u32 {
}
impl Overlap for <u32 as Default>::Id {
//[coherence]~^ ERROR conflicting implementations of trait `Overlap` for type `u32`
//[next]~^^ ERROR conflicting implementations of trait `Overlap` for type `u32`
type Assoc = Box<usize>;
}