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

ICE with default methods of the same name on derived trait #8885

Closed
Zolomon opened this issue Aug 30, 2013 · 3 comments
Closed

ICE with default methods of the same name on derived trait #8885

Zolomon opened this issue Aug 30, 2013 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Zolomon
Copy link

Zolomon commented Aug 30, 2013

fn main() {
    struct Example;

    trait BaseTrait { fn toString(&self) -> ~str { ~"BaseTrait" } }

    trait DerivedTrait : BaseTrait {
        fn new() -> Self;
        fn toString(&self) -> ~str { ~"DerivedTrait" }
    }

    impl BaseTrait for Example { }

    impl DerivedTrait for Example { fn new() -> Example { Example } }

    let bug: Example = DerivedTrait::new();
    println(fmt!("%s", bug.toString()));
}

klutzy@#rust was kind enough to give me debug output:

$ rustc.exe --version
d:\stone\rust\build-32\i686-pc-mingw32\stage2\bin\rustc.exe 0.8-pre
host: i686-pc-mingw32

$ RUST_LOG=rustc=1 rustc.exe x.rs
x.rs:32:20: 32:32 error: multiple applicable methods in scope
x.rs:32         println(fmt!("%s", bug.toString()));
                                   ^~~~~~~~~~~~
note: in expansion of fmt!
x.rs:32:9: 32:34 note: expansion site
task <unnamed> failed at 'report_static_candidate: bad item {crate: 0, node: 120}', D:\stone\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', d:\stone\rust\src\librustc\rustc.rs:376

We thought it was related to #8808, this might be a duplicate.

@emberian
Copy link
Member

cc @msullivan

@huonw
Copy link
Member

huonw commented Sep 3, 2013

Not sure why this is tagged E-needstest; it's still broken in 6a3dd30. Untagging.

@sanxiyn
Copy link
Member

sanxiyn commented Oct 3, 2013

I have a fix pending for #8808, and this is indeed a duplicate.

@sanxiyn sanxiyn closed this as completed Oct 3, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 4, 2022
…r=llogiq

Support `Weak` in [`rc_clone_in_vec_init`]

changelog: Support `Weak` in [`rc_clone_in_vec_init`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants