-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix coinductive coherence overlap checks
- Loading branch information
1 parent
408c732
commit 45ac61a
Showing
5 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![feature(trivial_bounds)] | ||
#![feature(negative_impls)] | ||
#![feature(rustc_attrs)] | ||
#![feature(with_negative_coherence)] | ||
#![allow(trivial_bounds)] | ||
|
||
#[rustc_strict_coherence] | ||
trait MyTrait {} | ||
|
||
struct Foo {} | ||
|
||
impl !MyTrait for Foo {} | ||
|
||
impl MyTrait for Foo where Foo: MyTrait {} | ||
//~^ ERROR: conflicting implementations of trait `MyTrait` | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
tests/ui/coherence/coherence-overlap-negative-cycles.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo` | ||
--> $DIR/coherence-overlap-negative-cycles.rs:14:1 | ||
| | ||
LL | impl MyTrait for Foo where Foo: MyTrait {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| first implementation here | ||
| conflicting implementation for `Foo` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |