This test now works

This commit is contained in:
Santiago Pastorino 2022-03-17 12:36:12 -03:00
parent 61a05ef8d6
commit 91846fe12a
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
3 changed files with 3 additions and 13 deletions

View File

@ -366,6 +366,7 @@ fn negative_impl_exists<'cx, 'tcx>(
return true;
}
// FIXME we should implement an `assemble_neg_candidates` fn
for o in util::elaborate_predicates(infcx.tcx, iter::once(o.predicate)) {
if resolve_negative_obligation(infcx, param_env, region_context, &o) {
return true;

View File

@ -1,3 +1,5 @@
// check-pass
#![feature(negative_impls)]
#![feature(rustc_attrs)]
#![feature(trait_alias)]
@ -13,7 +15,5 @@ impl !A for u32 {}
trait C {}
impl<T: AB> C for T {}
impl C for u32 {}
//~^ ERROR: conflicting implementations of trait `C` for type `u32` [E0119]
// FIXME this should work, we should implement an `assemble_neg_candidates` fn
fn main() {}

View File

@ -1,11 +0,0 @@
error[E0119]: conflicting implementations of trait `C` for type `u32`
--> $DIR/coherence-overlap-negate-alias-strict.rs:15:1
|
LL | impl<T: AB> C for T {}
| ------------------- first implementation here
LL | impl C for u32 {}
| ^^^^^^^^^^^^^^ conflicting implementation for `u32`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.