1
Fork 0

Change leak check lint message to behavior is likely to change in the future

This commit is contained in:
Santiago Pastorino 2024-02-06 15:22:13 -03:00
parent 8a497723e3
commit eee9d2a773
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
13 changed files with 18 additions and 20 deletions

View file

@ -1503,7 +1503,7 @@ declare_lint! {
Warn, Warn,
"distinct impls distinguished only by the leak-check code", "distinct impls distinguished only by the leak-check code",
@future_incompatible = FutureIncompatibleInfo { @future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps, reason: FutureIncompatibilityReason::Custom("the behavior may change in a future release"),
reference: "issue #56105 <https://github.com/rust-lang/rust/issues/56105>", reference: "issue #56105 <https://github.com/rust-lang/rust/issues/56105>",
}; };
} }

View file

@ -20,7 +20,7 @@ impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
//~^ ERROR conflicting implementations //~^ ERROR conflicting implementations
//~| WARNING this was previously accepted by the compiler //~| WARN the behavior may change in a future release
} }
fn main() {} fn main() {}

View file

@ -7,7 +7,7 @@ LL |
LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here note: the lint level is defined here

View file

@ -15,7 +15,7 @@ impl<'a> TheTrait for fn(&'a u8) {}
impl TheTrait for fn(&u8) { impl TheTrait for fn(&u8) {
//~^ ERROR conflicting implementations of trait //~^ ERROR conflicting implementations of trait
//~| WARNING this was previously accepted by the compiler //~| WARN the behavior may change in a future release
} }
fn main() {} fn main() {}

View file

@ -7,7 +7,7 @@ LL |
LL | impl TheTrait for fn(&u8) { LL | impl TheTrait for fn(&u8) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)` | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here note: the lint level is defined here

View file

@ -13,8 +13,8 @@ trait TheTrait {
impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
//~^ WARNING conflicting implementation //~^ WARN conflicting implementation
//~^^ WARNING this was previously accepted by the compiler but is being phased out //~| WARN the behavior may change in a future release
} }
fn main() {} fn main() {}

View file

@ -7,7 +7,7 @@ LL |
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
= note: `#[warn(coherence_leak_check)]` on by default = note: `#[warn(coherence_leak_check)]` on by default

View file

@ -31,7 +31,7 @@ where
R: ReturnWasmAbi, R: ReturnWasmAbi,
{ {
//~^^^^^ ERROR conflicting implementation //~^^^^^ ERROR conflicting implementation
//~| WARNING this was previously accepted //~| WARN the behavior may change in a future release
} }
fn main() {} fn main() {}

View file

@ -13,7 +13,7 @@ LL | | A: RefFromWasmAbi,
LL | | R: ReturnWasmAbi, LL | | R: ReturnWasmAbi,
| |_____________________^ conflicting implementation for `&dyn Fn(&_) -> _` | |_____________________^ conflicting implementation for `&dyn Fn(&_) -> _`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: downstream crates may implement trait `FromWasmAbi` for type `&_` = note: downstream crates may implement trait `FromWasmAbi` for type `&_`
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

View file

@ -6,7 +6,7 @@ LL | impl<T: ?Sized + Marker> FnMarker for fn(T) {}
LL | impl<T: ?Sized> FnMarker for fn(&T) {} LL | impl<T: ?Sized> FnMarker for fn(&T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&_)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&_)`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here note: the lint level is defined here

View file

@ -20,6 +20,6 @@ trait FnMarker {}
impl<T: ?Sized + Marker> FnMarker for fn(T) {} impl<T: ?Sized + Marker> FnMarker for fn(T) {}
impl<T: ?Sized> FnMarker for fn(&T) {} impl<T: ?Sized> FnMarker for fn(&T) {}
//[explicit]~^ ERROR conflicting implementations of trait `FnMarker` for type `fn(&_)` //[explicit]~^ ERROR conflicting implementations of trait `FnMarker` for type `fn(&_)`
//[explicit]~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[explicit]~| WARN the behavior may change in a future release
fn main() {} fn main() {}

View file

@ -12,8 +12,8 @@ impl SadBee for for<'a> fn(&'a ()) {
const ASSOC: usize = 0; const ASSOC: usize = 0;
} }
impl SadBee for fn(&'static ()) { impl SadBee for fn(&'static ()) {
//~^ WARNING conflicting implementations of trait //~^ WARN conflicting implementations of trait
//~| WARNING this was previously accepted //~| WARN the behavior may change in a future release
const ASSOC: usize = 100; const ASSOC: usize = 100;
} }
@ -21,9 +21,7 @@ struct Foo<T: SadBee>([u8; <T as SadBee>::ASSOC], PhantomData<T>)
where where
[(); <T as SadBee>::ASSOC]:; [(); <T as SadBee>::ASSOC]:;
fn covariant( fn covariant(v: &'static Foo<for<'a> fn(&'a ())>) -> &'static Foo<fn(&'static ())> {
v: &'static Foo<for<'a> fn(&'a ())>
) -> &'static Foo<fn(&'static ())> {
v v
//~^ ERROR mismatched types //~^ ERROR mismatched types
} }

View file

@ -7,13 +7,13 @@ LL | impl SadBee for for<'a> fn(&'a ()) {
LL | impl SadBee for fn(&'static ()) { LL | impl SadBee for fn(&'static ()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: the behavior may change in a future release
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
= note: `#[warn(coherence_leak_check)]` on by default = note: `#[warn(coherence_leak_check)]` on by default
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/invariant.rs:27:5 --> $DIR/invariant.rs:25:5
| |
LL | v LL | v
| ^ one type is more general than the other | ^ one type is more general than the other