Skip to content

ICE: fn in default method of trait #9123

Closed
@klutzy

Description

@klutzy
#[crate_type = "lib"];

pub trait X {
    fn x() {
        fn f() { }
        f();
    }
}

Build error with RUST_LOG=rustc:

error: internal compiler error: encode_symbol: id not found 4
task <unnamed> failed at 'explicit failure', C:\home\stone\rust\src\libsyntax\diagnostic.rs:95
task <unnamed> failed at 'explicit failure', C:\home\stone\rust\src\librustc\rustc.rs:376

It only failed when I tried to build library. I tested it on win32, but I think it is not windows-specific.

I found it when I tried to wrap default method to escape from #8753.

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