Skip to content

Commit 11ce5b7

Browse files
committed
Make overlapping_inherent_impls lint a hard error
1 parent 10b1739 commit 11ce5b7

File tree

5 files changed

+2
-10
lines changed

5 files changed

+2
-10
lines changed

src/librustc_lint/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
196196
id: LintId::of(SUPER_OR_SELF_IN_GLOBAL_PATH),
197197
reference: "issue #36888 <https://github.com/rust-lang/rust/issues/36888>",
198198
},
199-
FutureIncompatibleInfo {
200-
id: LintId::of(OVERLAPPING_INHERENT_IMPLS),
201-
reference: "issue #36889 <https://github.com/rust-lang/rust/issues/36889>",
202-
},
203199
FutureIncompatibleInfo {
204200
id: LintId::of(ILLEGAL_FLOATING_POINT_CONSTANT_PATTERN),
205201
reference: "issue #36890 <https://github.com/rust-lang/rust/issues/36890>",
@@ -263,4 +259,5 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
263259
store.register_removed("drop_with_repr_extern", "drop flags have been removed");
264260
store.register_removed("transmute_from_fn_item_types",
265261
"always cast functions before transmuting them");
262+
store.register_removed("overlapping_inherent_impls", "converted into hard error, see #36889");
266263
}

src/librustc_typeck/coherence/inherent_impls.rs

-1
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,3 @@ impl<'a, 'tcx> InherentCollect<'a, 'tcx> {
322322
}
323323
}
324324
}
325-

src/librustc_typeck/diagnostics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4212,4 +4212,5 @@ register_diagnostics! {
42124212
// but `{}` was found in the type `{}`
42134213
E0567, // auto traits can not have type parameters
42144214
E0568, // auto-traits can not have predicates,
4215+
E0592, // duplicate definitions with name `{}`
42154216
}

src/test/compile-fail/coherence-overlapping-inherent-impl-trait.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
// except according to those terms.
1010

1111
#![allow(dead_code)]
12-
#![deny(overlapping_inherent_impls)]
1312

1413
trait C {}
1514
impl C { fn f() {} } //~ ERROR duplicate definitions with name `f`
16-
//~^ WARN: this was previously accepted
1715
impl C { fn f() {} }
1816
fn main() { }

src/test/compile-fail/inherent-overlap.rs

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ struct Foo;
1717

1818
impl Foo {
1919
fn id() {} //~ ERROR duplicate definitions
20-
//~^ WARN previously accepted
2120
}
2221

2322
impl Foo {
@@ -28,7 +27,6 @@ struct Bar<T>(T);
2827

2928
impl<T> Bar<T> {
3029
fn bar(&self) {} //~ ERROR duplicate definitions
31-
//~^ WARN previously accepted
3230
}
3331

3432
impl Bar<u32> {
@@ -39,7 +37,6 @@ struct Baz<T>(T);
3937

4038
impl<T: Copy> Baz<T> {
4139
fn baz(&self) {} //~ ERROR duplicate definitions
42-
//~^ WARN previously accepted
4340
}
4441

4542
impl<T> Baz<Vec<T>> {

0 commit comments

Comments
 (0)