Make negative coherence work when there's impl negative on super predicates
This commit is contained in:
parent
78346489c6
commit
64dfd3b234
2 changed files with 34 additions and 8 deletions
18
src/test/ui/coherence/coherence-overlap-super-negative.rs
Normal file
18
src/test/ui/coherence/coherence-overlap-super-negative.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue