Skip to content

ICE with pattern match on xcrate-reexported enum variant #13872

Closed
@alexcrichton

Description

@alexcrichton
// foo.rs
#![crate_type = "rlib"]

pub enum A { B }

// bar.rs
#![crate_type = "rlib"]

extern crate foo;

pub use foo::B;

// baz.rs
#![crate_type = "rlib"]

extern crate bar;

use bar::B;

fn foo() {
    match B {
        B => {}
    }
}
$ rustc foo.rs && rustc -L. bar.rs && rustc -L. baz.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'lookup_item: id not found: 3', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/s
rc/librustc/metadata/decoder.rs:93

stack backtrace:
   1:     0x7fce725198e0 - rt::backtrace::imp::write::h04501b112343e4d4Mwa::v0.11.pre
   2:     0x7fce724792a0 - rt::unwind::begin_unwind_inner::hfcab8698d135644bR69::v0.11.pre
   3:     0x7fce72478f20 - rt::unwind::begin_unwind_fmt::h9ae5c1883262acc9159::v0.11.pre
   4:     0x7fce735f06d0 - metadata::decoder::lookup_item::h6461ed7d9ac122cbHma::v0.11.pre
   5:     0x7fce735f3e60 - metadata::decoder::get_type::h475e86478947faabNOa::v0.11.pre
   6:     0x7fce72e8bfd0 - middle::ty::lookup_item_type::h951ff31d32a85dbeEtP::v0.11.pre
   7:     0x7fce730a8410 - middle::typeck::check::_match::check_pat_variant::h840491536048be96mzZ::v0.11.pre
   8:     0x7fce730a4a20 - middle::typeck::check::_match::check_pat::h18df281016132163j3Z::v0.11.pre
   9:     0x7fce730a4110 - middle::typeck::check::_match::check_match::hb48b2a9d6ea92199QuZ::v0.11.pre
  10:     0x7fce73149130 - middle::typeck::check::check_expr_with_unifier::h68191f4991ee106cDy9::v0.11.pre
  11:     0x7fce7312a4d0 - middle::typeck::check::check_block_with_expected::h60238d28348d470clUb::v0.11.pre
  12:     0x7fce73125dd0 - middle::typeck::check::check_fn::h45867583beed19cbSn7::v0.11.pre
  13:     0x7fce73125b70 - middle::typeck::check::check_bare_fn::h5a74c0289e30c741Jd7::v0.11.pre
  14:     0x7fce7311d8d0 - middle::typeck::check::check_item::h418ccf98926b96ca6J7::v0.11.pre
  15:     0x7fce73125970 - middle::typeck::check::check_item_types::ha1866c21fb2bfb501c7::v0.11.pre
  16:     0x7fce73264150 - util::common::time::h561932986504602240::v0.11.pre
  17:     0x7fce73262ea0 - middle::typeck::check_crate::h9f866325bbdc0e67lIu::v0.11.pre
  18:     0x7fce736a01c0 - driver::driver::phase_3_run_analysis_passes::hfe12640f9b1312adTCf::v0.11.pre
  19:     0x7fce736a60d0 - driver::driver::compile_input::h0aada067d2ebbe0bG2f::v0.11.pre
  20:     0x7fce736cad30 - run_compiler::h7fbc638a4eb1256cxzn::v0.11.pre
  21:     0x7fce736e2bb0 - main_args::closure.91434
  22:     0x7fce736e10b0 - monitor::closure.91309
  23:     0x7fce736dc9a0 - task::TaskBuilder::try::closure.91075
  24:     0x7fce755a5f80 - task::spawn_opts::closure.7111
  25:     0x7fce72514920 - rt::task::Task::run::closure.40130
  26:     0x7fce7251f840 - rust_try
  27:     0x7fce72514760 - rt::task::Task::run::h84e43b6a7308c539UW7::v0.11.pre
  28:     0x7fce755a5d50 - task::spawn_opts::closure.7084
  29:     0x7fce72518420 - rt::thread::thread_start::hca3848d85a99d9cb7B8::v0.11.pre
  30:     0x7fce71e33ea0 - start_thread
  31:     0x7fce72143999 - __clone
  32:                0x0 - <unknown>

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