mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
Change leak check lint message to behavior is likely to change in the future
This commit is contained in:
parent
8a497723e3
commit
eee9d2a773
|
@ -1503,7 +1503,7 @@
|
|||
Warn,
|
||||
"distinct impls distinguished only by the leak-check code",
|
||||
@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>",
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
//~^ ERROR conflicting implementations
|
||||
//~| WARNING this was previously accepted by the compiler
|
||||
//~| WARN the behavior may change in a future release
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -7,7 +7,7 @@ LL |
|
|||
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`
|
||||
|
|
||||
= 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: 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
|
||||
|
|
|
@ -15,7 +15,7 @@ impl<'a> TheTrait for fn(&'a u8) {}
|
|||
|
||||
impl TheTrait for fn(&u8) {
|
||||
//~^ ERROR conflicting implementations of trait
|
||||
//~| WARNING this was previously accepted by the compiler
|
||||
//~| WARN the behavior may change in a future release
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -7,7 +7,7 @@ LL |
|
|||
LL | impl TheTrait 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: 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
|
||||
|
|
|
@ -13,8 +13,8 @@ fn foo(&self) {}
|
|||
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 {
|
||||
//~^ WARNING conflicting implementation
|
||||
//~^^ WARNING this was previously accepted by the compiler but is being phased out
|
||||
//~^ WARN conflicting implementation
|
||||
//~| WARN the behavior may change in a future release
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -7,7 +7,7 @@ LL |
|
|||
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`
|
||||
|
|
||||
= 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: 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
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b)
|
|||
R: ReturnWasmAbi,
|
||||
{
|
||||
//~^^^^^ ERROR conflicting implementation
|
||||
//~| WARNING this was previously accepted
|
||||
//~| WARN the behavior may change in a future release
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -13,7 +13,7 @@ LL | | A: RefFromWasmAbi,
|
|||
LL | | R: ReturnWasmAbi,
|
||||
| |_____________________^ 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: 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
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | impl<T: ?Sized + Marker> FnMarker for fn(T) {}
|
|||
LL | impl<T: ?Sized> FnMarker for fn(&T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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: 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
|
||||
|
|
|
@ -20,6 +20,6 @@ trait FnMarker {}
|
|||
impl<T: ?Sized + Marker> FnMarker for fn(T) {}
|
||||
impl<T: ?Sized> FnMarker for fn(&T) {}
|
||||
//[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() {}
|
||||
|
|
|
@ -12,18 +12,16 @@ impl SadBee for for<'a> fn(&'a ()) {
|
|||
const ASSOC: usize = 0;
|
||||
}
|
||||
impl SadBee for fn(&'static ()) {
|
||||
//~^ WARNING conflicting implementations of trait
|
||||
//~| WARNING this was previously accepted
|
||||
//~^ WARN conflicting implementations of trait
|
||||
//~| WARN the behavior may change in a future release
|
||||
const ASSOC: usize = 100;
|
||||
}
|
||||
|
||||
struct Foo<T: SadBee>([u8; <T as SadBee>::ASSOC], PhantomData<T>)
|
||||
where
|
||||
[(); <T as SadBee>::ASSOC]: ;
|
||||
[(); <T as SadBee>::ASSOC]:;
|
||||
|
||||
fn covariant(
|
||||
v: &'static Foo<for<'a> fn(&'a ())>
|
||||
) -> &'static Foo<fn(&'static ())> {
|
||||
fn covariant(v: &'static Foo<for<'a> fn(&'a ())>) -> &'static Foo<fn(&'static ())> {
|
||||
v
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@ LL | impl SadBee for for<'a> fn(&'a ()) {
|
|||
LL | impl SadBee for fn(&'static ()) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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: 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
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/invariant.rs:27:5
|
||||
--> $DIR/invariant.rs:25:5
|
||||
|
|
||||
LL | v
|
||||
| ^ one type is more general than the other
|
||||
|
|
Loading…
Reference in a new issue