Make negative coherence work when there's impl negative on super predicates

This commit is contained in:
Santiago Pastorino 2022-03-17 11:26:45 -03:00
parent 78346489c6
commit 64dfd3b234
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 34 additions and 8 deletions

View file

@ -0,0 +1,18 @@
// check-pass
#![feature(negative_impls)]
#![feature(rustc_attrs)]
#![feature(with_negative_coherence)]
trait Trait1: Trait2 {}
trait Trait2 {}
struct MyType {}
impl !Trait2 for MyType {}
#[rustc_strict_coherence]
trait Foo {}
impl<T: Trait1> Foo for T {}
impl Foo for MyType {}
fn main() {}