Skip to content

Commit 0039d73

Browse files
committed
Auto merge of #116493 - compiler-errors:coinductive-cycle-lint, r=lcnr
Bump `COINDUCTIVE_OVERLAP_IN_COHERENCE` to deny + warn in deps 1.73 is the first place this shows up in stable (recall that there was only 1 regression), so let's bump this to deny on nightly. r? lcnr
2 parents cc705b8 + 973d589 commit 0039d73

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4449,11 +4449,11 @@ declare_lint! {
44494449
/// on itself), the blanket impl is not considered to hold for `u8`. This will
44504450
/// change in a future release.
44514451
pub COINDUCTIVE_OVERLAP_IN_COHERENCE,
4452-
Warn,
4452+
Deny,
44534453
"impls that are not considered to overlap may be considered to \
44544454
overlap in the future",
44554455
@future_incompatible = FutureIncompatibleInfo {
4456-
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
4456+
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
44574457
reference: "issue #114040 <https://github.com/rust-lang/rust/issues/114040>",
44584458
};
44594459
}

tests/ui/coherence/warn-when-cycle-is-error-in-coherence.stderr

+25
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,28 @@ LL | #![deny(coinductive_overlap_in_coherence)]
2424

2525
error: aborting due to previous error
2626

27+
Future incompatibility report: Future breakage diagnostic:
28+
error: implementations of `PartialEq<Interval<_>>` for `Interval<_>` will conflict in the future
29+
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:13:1
30+
|
31+
LL | #[derive(PartialEq, Default)]
32+
| --------- the second impl is here
33+
...
34+
LL | / impl<T, Q> PartialEq<Q> for Interval<T>
35+
LL | |
36+
LL | |
37+
LL | | where
38+
LL | | T: Borrow<Q>,
39+
LL | | Q: ?Sized + PartialOrd,
40+
| |___________________________^ the first impl is here
41+
|
42+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
43+
= note: for more information, see issue #114040 <https://github.com/rust-lang/rust/issues/114040>
44+
= note: impls that are not considered to overlap may be considered to overlap in the future
45+
= note: `Interval<_>: PartialOrd` may be considered to hold in future releases, causing the impls to overlap
46+
note: the lint level is defined here
47+
--> $DIR/warn-when-cycle-is-error-in-coherence.rs:1:9
48+
|
49+
LL | #![deny(coinductive_overlap_in_coherence)]
50+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51+

0 commit comments

Comments
 (0)