Skip to content

ICE with using a condition from another crate #5446

Closed

Description

Getting an ICE trying to use a condition from another crate.

// condi.rc
#[link(name = "condi",
         vers = "0.1")];
#[crate_type = "lib"];

condition! {
    oops: int -> int;
}

// test.rs
extern mod condi;

fn main() {
    condi::oops::cond.raise(1);
}
  • rustc --lib condi.rc
  • rustc -L . test.rs

ICE

$ RUST_LOG=rustc=1,::rt::backtrace rustc -L . test.rs
rust: task failed at 'lookup_item: id not found: 24', /home/sonwow/project/rust/rust/src/librustc/metadata/decoder.rs:91
/home/sonwow/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fca25deaa5b]
/home/sonwow/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(+0x2a969)[0x7fca25dfb969]
/home/sonwow/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(upcall_fail+0x198)[0x7fca25dec858]
/home/sonwow/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xf5cab)[0x7fca27867cab]
......
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,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /home/sonwow/project/rust/rust/src/librustc/rustc.rc:359

However, there is no error if the condition is in the same crate.

// condi.rs
pub condition! {
    oops: int -> int;
}

// test.rs
pub mod condi;

fn main() {
    condi::oops::cond.raise(1);
}
  • rustc test.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions