-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make inductive cycles in coherence ambiguous always
- Loading branch information
1 parent
8a7b203
commit 7a4f862
Showing
6 changed files
with
27 additions
and
156 deletions.
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
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
46 changes: 6 additions & 40 deletions
46
tests/ui/coherence/warn-when-cycle-is-error-in-coherence.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 |
---|---|---|
@@ -1,51 +1,17 @@ | ||
error: implementations of `PartialEq<Interval<_>>` for `Interval<_>` will conflict in the future | ||
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:13:1 | ||
error[E0119]: conflicting implementations of trait `PartialEq<Interval<_>>` for type `Interval<_>` | ||
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:5:10 | ||
| | ||
LL | #[derive(PartialEq, Default)] | ||
| --------- the second impl is here | ||
| ^^^^^^^^^ conflicting implementation for `Interval<_>` | ||
... | ||
LL | / impl<T, Q> PartialEq<Q> for Interval<T> | ||
LL | | | ||
LL | | | ||
LL | | where | ||
LL | | T: Borrow<Q>, | ||
LL | | Q: ?Sized + PartialOrd, | ||
| |___________________________^ the first impl is here | ||
| |___________________________- first implementation here | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #114040 <https://github.com/rust-lang/rust/issues/114040> | ||
= note: impls that are not considered to overlap may be considered to overlap in the future | ||
= note: `Interval<_>: PartialOrd` may be considered to hold in future releases, causing the impls to overlap | ||
note: the lint level is defined here | ||
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:1:9 | ||
| | ||
LL | #![deny(coinductive_overlap_in_coherence)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 1 previous error | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: implementations of `PartialEq<Interval<_>>` for `Interval<_>` will conflict in the future | ||
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:13:1 | ||
| | ||
LL | #[derive(PartialEq, Default)] | ||
| --------- the second impl is here | ||
... | ||
LL | / impl<T, Q> PartialEq<Q> for Interval<T> | ||
LL | | | ||
LL | | | ||
LL | | where | ||
LL | | T: Borrow<Q>, | ||
LL | | Q: ?Sized + PartialOrd, | ||
| |___________________________^ the first impl is here | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #114040 <https://github.com/rust-lang/rust/issues/114040> | ||
= note: impls that are not considered to overlap may be considered to overlap in the future | ||
= note: `Interval<_>: PartialOrd` may be considered to hold in future releases, causing the impls to overlap | ||
note: the lint level is defined here | ||
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:1:9 | ||
| | ||
LL | #![deny(coinductive_overlap_in_coherence)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
For more information about this error, try `rustc --explain E0119`. |