diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-05 17:29:36 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-01-08 15:03:59 +0000 |
| commit | 8abf133c4b158a0c1b720c28cb25c482490c104f (patch) | |
| tree | fc7521a6f903e51d5270ee523b015cfd6f111cda /tests | |
| parent | 0ee9cfd54db7b5f4be35f026588904500c866196 (diff) | |
Make inductive cycles in coherence ambiguous always
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs | 7 | ||||
| -rw-r--r-- | tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr | 46 |
2 files changed, 8 insertions, 45 deletions
diff --git a/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs b/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs index 01f7d6ce901..c50bbcec521 100644 --- a/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs +++ b/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.rs @@ -1,18 +1,15 @@ -#![deny(coinductive_overlap_in_coherence)] - use std::borrow::Borrow; use std::cmp::Ordering; use std::marker::PhantomData; #[derive(PartialEq, Default)] +//~^ ERROR conflicting implementations of trait `PartialEq<Interval<_>>` for type `Interval<_>` pub(crate) struct Interval<T>(PhantomData<T>); // This impl overlaps with the `derive` unless we reject the nested // `Interval<?1>: PartialOrd<Interval<?1>>` candidate which results -// in a - currently inductive - cycle. +// in a -- currently inductive -- cycle. impl<T, Q> PartialEq<Q> for Interval<T> -//~^ ERROR implementations of `PartialEq<Interval<_>>` for `Interval<_>` will conflict in the future -//~| WARN this was previously accepted by the compiler but is being phased out where T: Borrow<Q>, Q: ?Sized + PartialOrd, diff --git a/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr b/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr index 4535b6f6811..af4dbfcad0e 100644 --- a/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr +++ b/tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr @@ -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`. |
