Skip to content

Non-consecutive crate IDs triggering assert #13560

Description

@sfackler

building rust-postgres/rust-postgres@650a030 triggers an assert inside of metadata::encoder:

task 'rustc' failed at 'assertion failed: `(left == right) && (right == left)` (left: `4`, right: `3`)', /home/sfackler/rust/rust/src/librustc/metadata/encoder.rs:1492
stack backtrace:
   1:     0x7f22ec4d88f0 - rt::backtrace::imp::write::h5dfe62f829bb8926qRa::v0.11.pre
   2:     0x7f22ec43a130 - rt::unwind::begin_unwind_inner::h656188078345464dTra::v0.11.pre
   3:     0x7f22ec439db0 - rt::unwind::begin_unwind_fmt::h0fa0fd6a17be09cb3qa::v0.11.pre
   4:     0x7f22ed5e0db0 - metadata::encoder::encode_metadata_inner::hf63f8d88e8b7eaa5o48::v0.11.pre
   5:     0x7f22ecf63b90 - metadata::encoder::encode_metadata::h6c0dd041c1ff6bb4S38::v0.11.pre
   6:     0x7f22ecf624e0 - middle::trans::base::write_metadata::h0a375886de86b464zbq::v0.11.pre
   7:     0x7f22ecf64190 - middle::trans::base::trans_crate::h03cceaf99acd8b6fugq::v0.11.pre
   8:     0x7f22ed697bb0 - driver::driver::phase_4_translate_to_llvm::h7b7bc374e3942267cAe::v0.11.pre
   9:     0x7f22ed699e20 - driver::driver::compile_input::h5aefc635514c08cd1Pe::v0.11.pre
  10:     0x7f22ed6be200 - run_compiler::h54519610e6366e1flom::v0.11.pre
  11:     0x7f22ed6d5900 - main_args::closure.91936
  12:     0x7f22ed6d4230 - monitor::closure.91821
  13:     0x7f22ed6cfb10 - task::TaskBuilder::try::closure.91587
  14:     0x7f22ef43fb90 - task::spawn_opts::closure.7971
  15:     0x7f22ec4d3920 - rt::task::Task::run::closure.40115
  16:     0x7f22ec4df4e0 - rust_try
  17:     0x7f22ec4d3760 - rt::task::Task::run::h88d5577d7084e0bafi8::v0.11.pre
  18:     0x7f22ef43f960 - task::spawn_opts::closure.7944
  19:     0x7f22ec4d7430 - rt::thread::thread_start::hc0c9989a147641340W8::v0.11.pre
  20:     0x7f22ebe13fe0 - start_thread
  21:     0x7f22ec10ece9 - clone
  22:                0x0 - <unknown>

Moving the #[phase(syntax)] extern crate rust_phf to the bottom of the crate list suppresses the issue. It looks like syntax-only crates are still taking a crate ID in creader which is creating "holes" at link-time. I tried simply removing the assert that tripped but that broke the world.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsI-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