Skip to content
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 #41052

Merged
merged 3 commits into from
Apr 6, 2017

Conversation

topecongiro
Copy link
Contributor

This is ought to be implemented in PR #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:

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

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@topecongiro
Copy link
Contributor Author

r? @estebank

@arielb1
Copy link
Contributor

arielb1 commented Apr 4, 2017

Remove the #[deny] from tests?

@estebank
Copy link
Contributor

estebank commented Apr 4, 2017

@topecongiro could you update src/test/compile-fail/inherent-overlap.rs so that they check for the secondary span label (//~ NOTE other definition for)? Even better if you can move those tests to be ui tests.

Other than that, it looks good to me. r=me.

@topecongiro
Copy link
Contributor Author

Thanks for comments!

@arielb1 #[deny(overlapping_inherent_impls)] is removed in #40728 (here). Or are there any others that should be removed?

@estebank I will rebase accordingly.

@estebank
Copy link
Contributor

estebank commented Apr 4, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Apr 4, 2017

📌 Commit db60b0b has been approved by estebank

arielb1 pushed a commit to arielb1/rust that referenced this pull request Apr 5, 2017
…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
```
bors added a commit that referenced this pull request Apr 6, 2017
Rollup of 12 pull requests

- Successful merges: #40479, #40561, #40709, #40815, #40909, #40927, #40943, #41015, #41028, #41052, #41054, #41065
- Failed merges:
@bors bors merged commit db60b0b into rust-lang:master Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants