Skip to content

ICE with default methods of the same name on the one type #8808

Closed
@huonw

Description

@huonw
trait Foo { fn method(&self) {} }
trait Bar { fn method(&self) {} }

impl Foo for uint {}
impl Bar for uint {}

fn main() {
    1u.method();
}

This happens as long as one version of method is a non-overrided default method.

doubletrait.rs:8:4: 8:16 error: multiple applicable methods in scope
doubletrait.rs:8     1u.method();
                     ^~~~~~~~~~~~
task <unnamed> failed at 'report_static_candidate: bad item {crate: 0, node: 53}', /home/huon/rust/src/librustc/middle/typeck/check/method.rs:1306
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task <unnamed> failed at 'explicit failure', /home/huon/rust/src/librustc/rustc.rs:377

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions