Skip to content

Commit cc1a618

Browse files
committed
Change leak check lint message to behavior is likely to change in the future
1 parent 6a4222b commit cc1a618

13 files changed

+18
-20
lines changed

compiler/rustc_lint_defs/src/builtin.rs

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

tests/ui/coherence/coherence-fn-implied-bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
2020

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

2626
fn main() {}

tests/ui/coherence/coherence-fn-implied-bounds.stderr

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

tests/ui/coherence/coherence-free-vs-bound-region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<'a> TheTrait for fn(&'a u8) {}
1515

1616
impl TheTrait for fn(&u8) {
1717
//~^ ERROR conflicting implementations of trait
18-
//~| WARNING this was previously accepted by the compiler
18+
//~| WARN the behavior may change in a future release
1919
}
2020

2121
fn main() {}

tests/ui/coherence/coherence-free-vs-bound-region.stderr

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

tests/ui/coherence/coherence-subtyping.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ trait TheTrait {
1313
impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
1414

1515
impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
16-
//~^ WARNING conflicting implementation
17-
//~^^ WARNING this was previously accepted by the compiler but is being phased out
16+
//~^ WARN conflicting implementation
17+
//~| WARN the behavior may change in a future release
1818
}
1919

2020
fn main() {}

tests/ui/coherence/coherence-subtyping.stderr

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

tests/ui/coherence/coherence-wasm-bindgen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ where
3131
R: ReturnWasmAbi,
3232
{
3333
//~^^^^^ ERROR conflicting implementation
34-
//~| WARNING this was previously accepted
34+
//~| WARN the behavior may change in a future release
3535
}
3636

3737
fn main() {}

tests/ui/coherence/coherence-wasm-bindgen.stderr

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

tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr

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

tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs

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

2525
fn main() {}

tests/ui/const-generics/invariant.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ impl SadBee for for<'a> fn(&'a ()) {
1212
const ASSOC: usize = 0;
1313
}
1414
impl SadBee for fn(&'static ()) {
15-
//~^ WARNING conflicting implementations of trait
16-
//~| WARNING this was previously accepted
15+
//~^ WARN conflicting implementations of trait
16+
//~| WARN the behavior may change in a future release
1717
const ASSOC: usize = 100;
1818
}
1919

2020
struct Foo<T: SadBee>([u8; <T as SadBee>::ASSOC], PhantomData<T>)
2121
where
22-
[(); <T as SadBee>::ASSOC]: ;
22+
[(); <T as SadBee>::ASSOC]:;
2323

24-
fn covariant(
25-
v: &'static Foo<for<'a> fn(&'a ())>
26-
) -> &'static Foo<fn(&'static ())> {
24+
fn covariant(v: &'static Foo<for<'a> fn(&'a ())>) -> &'static Foo<fn(&'static ())> {
2725
v
2826
//~^ ERROR mismatched types
2927
}

tests/ui/const-generics/invariant.stderr

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

1515
error[E0308]: mismatched types
16-
--> $DIR/invariant.rs:27:5
16+
--> $DIR/invariant.rs:25:5
1717
|
1818
LL | v
1919
| ^ one type is more general than the other

0 commit comments

Comments
 (0)