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

Structs with duplicate methods do not cause compilation warning or error #7062

Closed
tikue opened this issue Jun 11, 2013 · 2 comments
Closed
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@tikue
Copy link
Contributor

tikue commented Jun 11, 2013

pub struct Foo;

impl Foo {
    pub fn bar(&self) {
        println("I'm bar 1");
    }

    pub fn bar(&self) {
        println("I'm bar 2");
    }
}

fn main() {
    let foo = Foo;
    foo.bar();
}

The above program compiles and prints I'm bar 1.

@pcwalton
Copy link
Contributor

Nominating for backwards compatibility

@luqmana
Copy link
Member

luqmana commented Jun 11, 2013

This also applies to traits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

4 participants