Skip to content

ICE: Expected module, found DefId #75982

Closed
@matthiaskrgr

Description

@matthiaskrgr

Found in the pr-75180 crater run:

git clone https://github.com/getditto/safer_ffi.git
cd safer_ffi
git checkout 661708808922a0dc625a864b0f880d6b8dc4a412
rm -f rust-toolchain
cargo check --all-targets

ICEs:

    Checking safer-ffi v0.0.5 (/tmp/safer_ffi)
thread 'rustc' panicked at 'Expected module, found DefId(20:196)', src/librustc_metadata/rmeta/decoder.rs:1178:13
stack backtrace:
   0:     0x7f8e87a6d380 - std::backtrace_rs::backtrace::libunwind::trace::ha1eabb142084ea37
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x7f8e87a6d380 - std::backtrace_rs::backtrace::trace_unsynchronized::hbb8825661d997281
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x7f8e87a6d380 - std::sys_common::backtrace::_print_fmt::h26d850e2f7183914
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys_common/backtrace.rs:79
   3:     0x7f8e87a6d380 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3834b06f68a2b012
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys_common/backtrace.rs:58
   4:     0x7f8e87adbc0c - core::fmt::write::h3a043650ba7bf668
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/core/src/fmt/mod.rs:1082
   5:     0x7f8e87a5f6c7 - std::io::Write::write_fmt::h9c0c8944a1898139
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/io/mod.rs:1514
   6:     0x7f8e87a72030 - std::sys_common::backtrace::_print::h693c0c2cc41d4d10
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys_common/backtrace.rs:61
   7:     0x7f8e87a72030 - std::sys_common::backtrace::print::h213be73e5670b8ea
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys_common/backtrace.rs:48
   8:     0x7f8e87a72030 - std::panicking::default_hook::{{closure}}::h2d49a3361cc4e7ea
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:200
   9:     0x7f8e87a71d7c - std::panicking::default_hook::hd41fbdeba93207ba
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:219
  10:     0x7f8e882e9419 - rustc_driver::report_ice::hb57fcf9c0f585ed3
  11:     0x7f8e7b96b0c6 - <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call::hd2e9ad5b225448e0
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1056
  12:     0x7f8e7b96ee35 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h9a8b4e1b7d7b7151
                               at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:319
  13:     0x7f8e87a727d8 - std::panicking::rust_panic_with_hook::hcab398664b4bd473
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:573
  14:     0x7f8e87a72389 - std::panicking::begin_panic_handler::{{closure}}::h7512c6f2998ba93d
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:476
  15:     0x7f8e87a6d7ec - std::sys_common::backtrace::__rust_end_short_backtrace::h1a25d7e7e1864d3d
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys_common/backtrace.rs:153
  16:     0x7f8e87a72349 - rust_begin_unwind
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:475
  17:     0x7f8e87a722fb - std::panicking::begin_panic_fmt::h8af3eb0f50edc2d0
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/panicking.rs:429
  18:     0x7f8e8a0f0d8a - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::module_expansion_untracked::hf229b6c13e61f427
  19:     0x7f8e891f9a6d - rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module::h1a23472d3fe1dc18
  20:     0x7f8e891f9a1c - rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module::h1a23472d3fe1dc18
  21:     0x7f8e891f9e86 - rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::macro_def_scope::h4b47b2f0ff8473c9
  22:     0x7f8e8920cdaa - rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_macro_invocation::h65535b2f99bafce6
  23:     0x7f8e8a2ee111 - rustc_expand::expand::MacroExpander::fully_expand_fragment::h69c034c6d61249c8
  24:     0x7f8e8a2ed580 - rustc_expand::expand::MacroExpander::expand_crate::h8c2d8929612310ca
  25:     0x7f8e885bfe5c - rustc_session::utils::<impl rustc_session::session::Session>::time::haaf9a39853e2b108
  26:     0x7f8e8860fede - rustc_interface::passes::configure_and_expand_inner::hd880720adede20b1
  27:     0x7f8e885d82e9 - rustc_interface::passes::configure_and_expand::{{closure}}::h0e29c4151fbcfea0
  28:     0x7f8e885cd76f - rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new::hdfd7dbb0b9eb862c
  29:     0x7f8e8860eed5 - rustc_interface::passes::configure_and_expand::h0561e619d3ea6666
  30:     0x7f8e8865a408 - rustc_interface::queries::Queries::expansion::h03c4340e7e1e4bec
  31:     0x7f8e8830ccf7 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h037edd44e25c852a
  32:     0x7f8e882a2957 - rustc_span::with_source_map::h8bee9729eacaf0e5
  33:     0x7f8e8830e983 - rustc_interface::interface::create_compiler_and_run::hca1ea19f87aad490
  34:     0x7f8e882ed12a - scoped_tls::ScopedKey<T>::set::h98a472b48acc2e14
  35:     0x7f8e88301587 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0fbaefb3a51451a7
  36:     0x7f8e8828cf3e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7a49202ee8dc3a27
  37:     0x7f8e87a81d7a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h8a8db08de617a605
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/alloc/src/boxed.rs:1042
  38:     0x7f8e87a81d7a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hddfcff0ffd25c0c4
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/alloc/src/boxed.rs:1042
  39:     0x7f8e87a81d7a - std::sys::unix::thread::Thread::new::thread_start::h8e648f9ee2e9cb3a
                               at /rustc/2d8a3b9181f41d3af9b9f016c5d73b2553e344bf/library/std/src/sys/unix/thread.rs:87
  40:     0x7f8e87974422 - start_thread
  41:     0x7f8e87892bf3 - __clone
  42:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.47.0-nightly (2d8a3b918 2020-08-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `safer-ffi`.

To learn more, run the command again with --verbose.

This ICE happens on:
rustc 1.47.0-beta.1 (0f91f5c28 2020-08-25)
rustc 1.47.0-nightly (2d8a3b918 2020-08-26)
but rustc 1.45.2 (d3fb005a3 2020-07-31) only shows a compiler error.

Metadata

Metadata

Assignees

Labels

A-metadataArea: Crate metadataC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ICEBreaker-Cleanup-CrewHelping to "clean up" bugs with minimal examples and bisectionsP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions