Skip to content

Can't implement methods with the same name on non-overlapping generic specializations #10699

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

Closed
jdm opened this issue Nov 28, 2013 · 3 comments
Closed
Labels
A-type-system Area: Type system

Comments

@jdm
Copy link
Contributor

jdm commented Nov 28, 2013

struct Foo<T>;
impl Foo<int> {
  fn foo() {}
}
impl Foo<f64> {
  fn foo() {}
}
t.rs:6:2: 6:13 error: duplicate definition of value `foo`
t.rs:6   fn foo() {}
         ^~~~~~~~~~~
t.rs:3:2: 3:13 note: first definition of value `foo` here
t.rs:3   fn foo() {}
         ^~~~~~~~~~~

This is frustrating.

@bnoordhuis
Copy link
Contributor

Triage: still an issue as of 136ab3c.

@steveklabnik
Copy link
Member

@nikomatsakis what do you think of this issue? Is this a bug of some kind, or would this be an RFC-worthy change to the type system?

@steveklabnik steveklabnik added the A-type-system Area: Type system label Jan 23, 2015
@alexcrichton
Copy link
Member

This is currently allowed, so closing.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
Clippy Book Chapter Updates Reborn: Refresh Lint Configuration's looks

This PR modernizes and clears up some confusion with the "Lint Configuration Options" chapter from the book.

### Changes

- **Remove 'Option - Default Value" table**

    - Why was it even there?
    - It shouldn't be the first thing an user sees when they enter the chapter. It's clunky, ugly and not useful. The default values for configs are stated in a per-config basis if needed.

- **Add a simple description of what the chapter contains, and the scheme of each configuration option**

- **Minor formatting, mainly adding code fragments to code text**

    - It seemed weird and jarring not having back-ticks on text like "arithmetic_side_effects".
    -  Improves readability and separation between configs.

- **Separate a little bit the Affected Lints list + "Affected lists" message**

    - Not having something indicating that the list is about the lints that use the configuration option is confusing.
    - It isn't as important as the description and example. Therefore should be separated a little bit imo

---

This is an independent effort from rust-lang#10597, but as it's still a Book Chapter Update, I thought it would be cool to include it here. I'm going to keep the reviewing process for this PR to rustbot's desires.

[Rendered](https://github.com/blyxyas/rust-clippy/blob/book-lint_config/book/src/lint_configuration.md)
[Current](https://github.com/rust-lang/rust-clippy/blob/master/book/src/lint_configuration.md)

changelog: Refresh styling from the "Lint Configuration Options" book chapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

4 participants