Skip to content

Commit

Permalink
make lint warn by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Feb 6, 2020
1 parent 363faba commit 4b3c66d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/librustc_session/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
8 changes: 3 additions & 5 deletions src/test/ui/coherence/coherence-subtyping.old.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
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
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

8 changes: 3 additions & 5 deletions src/test/ui/coherence/coherence-subtyping.re.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
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
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

5 changes: 3 additions & 2 deletions src/test/ui/coherence/coherence-subtyping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// universe transition (#56105) may eventually become an error.

// revisions: old re
// check-pass

trait TheTrait {
fn foo(&self) {}
Expand All @@ -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
}

Expand Down

0 comments on commit 4b3c66d

Please sign in to comment.