From 4b3c66d2c309a16d48c2b7f992a2038016a098d3 Mon Sep 17 00:00:00 2001
From: Niko Matsakis <niko@alum.mit.edu>
Date: Thu, 6 Feb 2020 15:59:09 -0500
Subject: [PATCH] make lint warn by default

---
 src/librustc_session/lint/builtin.rs                 | 2 +-
 src/test/ui/coherence/coherence-subtyping.old.stderr | 8 +++-----
 src/test/ui/coherence/coherence-subtyping.re.stderr  | 8 +++-----
 src/test/ui/coherence/coherence-subtyping.rs         | 5 +++--
 4 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/librustc_session/lint/builtin.rs b/src/librustc_session/lint/builtin.rs
index cd972bdb993d2..0038deda91b43 100644
--- a/src/librustc_session/lint/builtin.rs
+++ b/src/librustc_session/lint/builtin.rs
@@ -262,7 +262,7 @@ declare_lint! {
 
 declare_lint! {
     pub COHERENCE_LEAK_CHECK,
-    Deny,
+    Warn,
     "distinct impls distinguished only by the leak-check code",
     @future_incompatible = FutureIncompatibleInfo {
         reference: "issue #56105 <https://github.com/rust-lang/rust/issues/56105>",
diff --git a/src/test/ui/coherence/coherence-subtyping.old.stderr b/src/test/ui/coherence/coherence-subtyping.old.stderr
index 6bae152bd2a8e..76f5cc1b78232 100644
--- a/src/test/ui/coherence/coherence-subtyping.old.stderr
+++ b/src/test/ui/coherence/coherence-subtyping.old.stderr
@@ -1,5 +1,5 @@
-error: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
-  --> $DIR/coherence-subtyping.rs:15:1
+warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
+  --> $DIR/coherence-subtyping.rs:16:1
    |
 LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
    | ---------------------------------------------------------- first implementation here
@@ -7,10 +7,8 @@ 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`
    |
-   = note: `#[deny(coherence_leak_check)]` on by default
+   = note: `#[warn(coherence_leak_check)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error 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
 
-error: aborting due to previous error
-
diff --git a/src/test/ui/coherence/coherence-subtyping.re.stderr b/src/test/ui/coherence/coherence-subtyping.re.stderr
index 6bae152bd2a8e..76f5cc1b78232 100644
--- a/src/test/ui/coherence/coherence-subtyping.re.stderr
+++ b/src/test/ui/coherence/coherence-subtyping.re.stderr
@@ -1,5 +1,5 @@
-error: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
-  --> $DIR/coherence-subtyping.rs:15:1
+warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
+  --> $DIR/coherence-subtyping.rs:16:1
    |
 LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
    | ---------------------------------------------------------- first implementation here
@@ -7,10 +7,8 @@ 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`
    |
-   = note: `#[deny(coherence_leak_check)]` on by default
+   = note: `#[warn(coherence_leak_check)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error 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
 
-error: aborting due to previous error
-
diff --git a/src/test/ui/coherence/coherence-subtyping.rs b/src/test/ui/coherence/coherence-subtyping.rs
index 9f45290c65b13..f5c1d92411baa 100644
--- a/src/test/ui/coherence/coherence-subtyping.rs
+++ b/src/test/ui/coherence/coherence-subtyping.rs
@@ -5,6 +5,7 @@
 // universe transition (#56105) may eventually become an error.
 
 // revisions: old re
+// check-pass
 
 trait TheTrait {
     fn foo(&self) {}
@@ -13,9 +14,9 @@ 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 {
-    //[re]~^ ERROR conflicting implementation
+    //[re]~^ WARNING conflicting implementation
     //[re]~^^ WARNING this was previously accepted by the compiler but is being phased out
-    //[old]~^^^ ERROR conflicting implementation
+    //[old]~^^^ WARNING conflicting implementation
     //[old]~^^^^ WARNING this was previously accepted by the compiler but is being phased out
 }