Skip to content

Unexported ifaces should export metadata anyway for cross-crate monomorphisation #2733

Closed
@bblum

Description

@bblum

Spent too long figuring out an ICE: "'lookup_item: id not found: 51905', /home/bblum/rust/src/rustc/metadata/decoder.rs:96".

Turns out I had defined an iface in libcore/task.rs to use in a polymorphic function. I had exported the function, but not the iface. Then when attempting to compile a program that linked against libcore, this failure arose from type_of() in trans/type_of.rs when trying to #debug-print the type, called from monomorphic_fn() in trans/base.rs.

As a workaround, exporting the iface makes the metadata lookup go through.

Maybe all enums need this treatment too?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-linkageArea: linking into static, shared libraries and binariesI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions