-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make overlapping_inherent_impls lint a hard error #40728
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
self.tcx.span_of_impl(item1).unwrap(), | ||
E0592, | ||
"duplicate definitions with name `{}`", | ||
name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, but could you add a span_label
to this diagnostic pointing at item1
's and another pointing at item2
's span?
That way the code output would look this way:
error: duplicate definitions with name `id`
--> <anon>:4:5
|
4 | fn id() {} //~ ERROR duplicate definitions
| ^^^^^^^^^^ duplicate definitions for `id`
...
8 | fn id() {}
| ---------- other definition for `id`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estebank Thank you for your comment. I will rebase accordingly 😸
☔ The latest upstream changes (presumably #40867) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r+ |
📌 Commit 11ce5b7 has been approved by |
⌛ Testing commit 11ce5b7 with merge ba21ac0... |
💔 Test failed - status-travis |
@bors: retry
|
⌛ Testing commit 11ce5b7 with merge c9c7c45... |
💔 Test failed - status-appveyor |
… On Fri, Mar 31, 2017 at 5:13 AM, bors ***@***.***> wrote:
💔 Test failed - status-appveyor
<https://ci.appveyor.com/project/rust-lang/rust/build/1.0.2651>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40728 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95Fg6QODDMRAqL6l5AItVLmjQTkjGks5rrN_PgaJpZM4Mk0TO>
.
|
Make overlapping_inherent_impls lint a hard error Closes rust-lang#36889.
Make overlapping_inherent_impls lint a hard error Closes rust-lang#36889.
@topecongiro, is it me or the rebased version that was merged didn't have the "hard error" code? If that is the case, could you please send a PR with it? |
…pls, r=estebank Make 'overlapping_inherent_impls' lint a hard error This is ought to be implemented in PR rust-lang#40728. Unfortunately, when I rebased the PR to resolve merge conflict, the "hard error" code disappeared. This PR complements the initial PR. Now the following rust code gives the following error: ```rust struct Foo; impl Foo { fn id() {} } impl Foo { fn id() {} } fn main() {} ``` ``` error[E0592]: duplicate definitions with name `id` --> /home/topecongiro/test.rs:4:5 | 4 | fn id() {} | ^^^^^^^^^^ duplicate definitions for `id` ... 8 | fn id() {} | ---------- other definition for `id` error: aborting due to previous error ```
Closes #36889.