about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2024-02-06 15:22:13 -0300
committerSantiago Pastorino <spastorino@gmail.com>2024-02-18 19:16:17 -0300
commiteee9d2a773f8c38c83f251c41ea2ec879d7c825c (patch)
tree605d84d4201d542d0e054a5314f42fb0bb80f964
parent8a497723e311a62fccb1f0bf40e79c6519744a12 (diff)
downloadrust-eee9d2a773f8c38c83f251c41ea2ec879d7c825c.tar.gz
rust-eee9d2a773f8c38c83f251c41ea2ec879d7c825c.zip
Change leak check lint message to behavior is likely to change in the future
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs2
-rw-r--r--tests/ui/coherence/coherence-fn-implied-bounds.rs2
-rw-r--r--tests/ui/coherence/coherence-fn-implied-bounds.stderr2
-rw-r--r--tests/ui/coherence/coherence-free-vs-bound-region.rs2
-rw-r--r--tests/ui/coherence/coherence-free-vs-bound-region.stderr2
-rw-r--r--tests/ui/coherence/coherence-subtyping.rs4
-rw-r--r--tests/ui/coherence/coherence-subtyping.stderr2
-rw-r--r--tests/ui/coherence/coherence-wasm-bindgen.rs2
-rw-r--r--tests/ui/coherence/coherence-wasm-bindgen.stderr2
-rw-r--r--tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr2
-rw-r--r--tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs2
-rw-r--r--tests/ui/const-generics/invariant.rs10
-rw-r--r--tests/ui/const-generics/invariant.stderr4
13 files changed, 18 insertions, 20 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 3f5d3c25971..8ba5942898c 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -1503,7 +1503,7 @@ declare_lint! {
     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>",
     };
 }
diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.rs b/tests/ui/coherence/coherence-fn-implied-bounds.rs
index 4539af9a32e..0ae54284102 100644
--- a/tests/ui/coherence/coherence-fn-implied-bounds.rs
+++ b/tests/ui/coherence/coherence-fn-implied-bounds.rs
@@ -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() {}
diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.stderr b/tests/ui/coherence/coherence-fn-implied-bounds.stderr
index b0dea746709..ece3288989d 100644
--- a/tests/ui/coherence/coherence-fn-implied-bounds.stderr
+++ b/tests/ui/coherence/coherence-fn-implied-bounds.stderr
@@ -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
diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.rs b/tests/ui/coherence/coherence-free-vs-bound-region.rs
index 2f5c49d293d..89d0005fb79 100644
--- a/tests/ui/coherence/coherence-free-vs-bound-region.rs
+++ b/tests/ui/coherence/coherence-free-vs-bound-region.rs
@@ -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() {}
diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.stderr b/tests/ui/coherence/coherence-free-vs-bound-region.stderr
index c97b32e429d..e45cf5ad3a4 100644
--- a/tests/ui/coherence/coherence-free-vs-bound-region.stderr
+++ b/tests/ui/coherence/coherence-free-vs-bound-region.stderr
@@ -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
diff --git a/tests/ui/coherence/coherence-subtyping.rs b/tests/ui/coherence/coherence-subtyping.rs
index da0cc2d0265..4365ad5c884 100644
--- a/tests/ui/coherence/coherence-subtyping.rs
+++ b/tests/ui/coherence/coherence-subtyping.rs
@@ -13,8 +13,8 @@ trait TheTrait {
 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() {}
diff --git a/tests/ui/coherence/coherence-subtyping.stderr b/tests/ui/coherence/coherence-subtyping.stderr
index 9d90019a50f..42f256ace78 100644
--- a/tests/ui/coherence/coherence-subtyping.stderr
+++ b/tests/ui/coherence/coherence-subtyping.stderr
@@ -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
diff --git a/tests/ui/coherence/coherence-wasm-bindgen.rs b/tests/ui/coherence/coherence-wasm-bindgen.rs
index ee09a72449b..57daaa134d4 100644
--- a/tests/ui/coherence/coherence-wasm-bindgen.rs
+++ b/tests/ui/coherence/coherence-wasm-bindgen.rs
@@ -31,7 +31,7 @@ where
     R: ReturnWasmAbi,
 {
     //~^^^^^ ERROR conflicting implementation
-    //~| WARNING this was previously accepted
+    //~| WARN the behavior may change in a future release
 }
 
 fn main() {}
diff --git a/tests/ui/coherence/coherence-wasm-bindgen.stderr b/tests/ui/coherence/coherence-wasm-bindgen.stderr
index b3c3dac612d..939f1fce9a4 100644
--- a/tests/ui/coherence/coherence-wasm-bindgen.stderr
+++ b/tests/ui/coherence/coherence-wasm-bindgen.stderr
@@ -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
diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
index 5368db29338..832c56a4554 100644
--- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
+++ b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr
@@ -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
diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
index 7967002e021..e487dcc3c0e 100644
--- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
+++ b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs
@@ -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() {}
diff --git a/tests/ui/const-generics/invariant.rs b/tests/ui/const-generics/invariant.rs
index 39d658be67d..ee4ad4e7c4e 100644
--- a/tests/ui/const-generics/invariant.rs
+++ b/tests/ui/const-generics/invariant.rs
@@ -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
 }
diff --git a/tests/ui/const-generics/invariant.stderr b/tests/ui/const-generics/invariant.stderr
index f631e131146..b4e46e55268 100644
--- a/tests/ui/const-generics/invariant.stderr
+++ b/tests/ui/const-generics/invariant.stderr
@@ -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