Skip to content

Assertion failed: import.imported_module.get().is_none() #85992

Closed
@ralpha

Description

@ralpha

Code

Exact code unknown code.
The error was generated by using cargo check.
Rerunning after cargo clean did not fix this.

Did not resolve this yet at the time of writing this.
This might be related to: #83336

But I think this was because I compiles first and got this error:

error: internal compiler error: expansion entered force mode without producing any errors
 --> controllers/src/server/launch_errors.rs:6:13
  |
6 |             error!("{}", err);
  |             ^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_expand/src/expand.rs:460:34

This was expected to give an error (needed to be log::error!(...) )

Full backtrace on the fist check:

thread 'rustc' panicked at 'assertion failed: import.imported_module.get().is_none()', compiler/rustc_resolve/src/imports.rs:960:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.54.0-nightly (b663c0f4f 2021-05-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
error: internal compiler error: expansion entered force mode without producing any errors
 --> controllers/src/server/launch_errors.rs:6:13
  |
6 |             error!("{}", err);
  |             ^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_expand/src/expand.rs:460:34

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1021:13
stack backtrace:
   0:     0x7f76d393a060 - std::backtrace_rs::backtrace::libunwind::trace::ha3c9a071e276aa0f
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f76d393a060 - std::backtrace_rs::backtrace::trace_unsynchronized::ha4cae02438775bee
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f76d393a060 - std::sys_common::backtrace::_print_fmt::h7a4100df230ddc18
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f76d393a060 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h90c5a98ac3ece013
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f76d39a7a8c - core::fmt::write::h7aa6cd0067dca82a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/core/src/fmt/mod.rs:1110:17
   5:     0x7f76d392b8e5 - std::io::Write::write_fmt::h2fe56180f3d20a2a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/io/mod.rs:1588:15
   6:     0x7f76d393debb - std::sys_common::backtrace::_print::hfde54a51698eed27
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f76d393debb - std::sys_common::backtrace::print::h2cdb1fdb4dae15b4
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f76d393debb - std::panicking::default_hook::{{closure}}::h6b7f85bf6255ae64
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:208:50
   9:     0x7f76d393d991 - std::panicking::default_hook::h6033f351925c444f
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:225:9
  10:     0x7f76d410d72d - rustc_driver::report_ice::hedef9fb40338a23b
  11:     0x7f76bf86d323 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hacacf077fc128abd
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1589:9
  12:     0x7f76bf866708 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h06c8f662d5992f73
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f76d393e6c6 - std::panicking::rust_panic_with_hook::hde05f051c0c95c4a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:626:17
  14:     0x7f76d393e1a7 - std::panicking::begin_panic_handler::{{closure}}::h49a1ef32b3e38727
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:519:13
  15:     0x7f76d393a55c - std::sys_common::backtrace::__rust_end_short_backtrace::hed2471df08b67583
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7f76d393e109 - rust_begin_unwind
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:515:5
  17:     0x7f76d3906fcb - std::panicking::begin_panic_fmt::hf6913515f24c4986
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:457:5
  18:     0x7f76d6579629 - rustc_errors::HandlerInner::flush_delayed::h3322626edccdc88d
  19:     0x7f76d65780dd - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::he175ba8469a915c4
  20:     0x7f76d5c09f56 - core::ptr::drop_in_place<rustc_session::parse::ParseSess>::h5c63f86f5df3788a
  21:     0x7f76d5c0c45e - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h11c57329750d41f3
  22:     0x7f76d5c1ce6d - core::ptr::drop_in_place<rustc_interface::interface::Compiler>::hb8a82cba31a9cf29
  23:     0x7f76d5c12798 - rustc_span::with_session_globals::h6569bbb8a4ea9d61
  24:     0x7f76d5c368ff - std::sys_common::backtrace::__rust_begin_short_backtrace::h428dbdd434c4f112
  25:     0x7f76d5c0d7b5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb7785b7f871527db
  26:     0x7f76d394abb7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h79456d14677dd3c1
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1575:9
  27:     0x7f76d394abb7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5c40c73501d779c0
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1575:9
  28:     0x7f76d394abb7 - std::sys::unix::thread::Thread::new::thread_start::h55fc0fe77abc7cf7
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys/unix/thread.rs:71:17
  29:     0x7f76d368b6db - start_thread
  30:     0x7f76d2fa871f - __clone
  31:                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.54.0-nightly (b663c0f4f 2021-05-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `controllers`

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (b663c0f4f 2021-05-29)
binary: rustc
commit-hash: b663c0f4f6ff84a8c9df0f708e1f8d628330d973
commit-date: 2021-05-29
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Problem persists after updating to last nightly:

rustc 1.54.0-nightly (cc77ba46f 2021-06-03)
binary: rustc
commit-hash: cc77ba46fcb2d288aa01554b48cd586c5827c3dd
commit-date: 2021-06-03
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

thread 'rustc' panicked at 'assertion failed: import.imported_module.get().is_none()', compiler/rustc_resolve/src/imports.rs:960:21
stack backtrace:
<see below>
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.54.0-nightly (b663c0f4f 2021-05-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
error: could not compile `controllers`
Backtrace (After trying to recheck it)

stack backtrace:
   0:     0x7f00b46a2060 - std::backtrace_rs::backtrace::libunwind::trace::ha3c9a071e276aa0f
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f00b46a2060 - std::backtrace_rs::backtrace::trace_unsynchronized::ha4cae02438775bee
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f00b46a2060 - std::sys_common::backtrace::_print_fmt::h7a4100df230ddc18
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f00b46a2060 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h90c5a98ac3ece013
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f00b470fa8c - core::fmt::write::h7aa6cd0067dca82a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/core/src/fmt/mod.rs:1110:17
   5:     0x7f00b46938e5 - std::io::Write::write_fmt::h2fe56180f3d20a2a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/io/mod.rs:1588:15
   6:     0x7f00b46a5ebb - std::sys_common::backtrace::_print::hfde54a51698eed27
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f00b46a5ebb - std::sys_common::backtrace::print::h2cdb1fdb4dae15b4
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f00b46a5ebb - std::panicking::default_hook::{{closure}}::h6b7f85bf6255ae64
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:208:50
   9:     0x7f00b46a5991 - std::panicking::default_hook::h6033f351925c444f
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:225:9
  10:     0x7f00b4e7572d - rustc_driver::report_ice::hedef9fb40338a23b
  11:     0x7f00a055b323 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hacacf077fc128abd
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1589:9
  12:     0x7f00a0554708 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h06c8f662d5992f73
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f00b46a66c6 - std::panicking::rust_panic_with_hook::hde05f051c0c95c4a
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:626:17
  14:     0x7f00b46a6177 - std::panicking::begin_panic_handler::{{closure}}::h49a1ef32b3e38727
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:517:13
  15:     0x7f00b46a255c - std::sys_common::backtrace::__rust_end_short_backtrace::hed2471df08b67583
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7f00b46a6109 - rust_begin_unwind
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/panicking.rs:515:5
  17:     0x7f00b4671081 - core::panicking::panic_fmt::hbe99dddd3092ba3c
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/core/src/panicking.rs:92:14
  18:     0x7f00b4670fcd - core::panicking::panic::h3de4db67bd397eb3
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/core/src/panicking.rs:50:5
  19:     0x7f00b6cbd840 - rustc_resolve::imports::ImportResolver::finalize_import::h76c75e107025e2e2
  20:     0x7f00b6cbc264 - rustc_resolve::imports::ImportResolver::finalize_imports::he85ec07cc64ca3c8
  21:     0x7f00b6c82a3d - rustc_session::utils::<impl rustc_session::session::Session>::time::h9854589b3d4dd27d
  22:     0x7f00b6c9bdd8 - rustc_resolve::Resolver::resolve_crate::h96defa47057f9e60
  23:     0x7f00b69a7772 - rustc_interface::passes::configure_and_expand_inner::h366bd5d9705caf86
  24:     0x7f00b69a4e7f - rustc_interface::passes::configure_and_expand::{{closure}}::hdcd19ae0ae2f6622
  25:     0x7f00b69a1de9 - rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new::ha9961759bbb719c4
  26:     0x7f00b69a6a01 - rustc_interface::passes::configure_and_expand::hd360f21cdf4b8ebb
  27:     0x7f00b69b31f2 - rustc_interface::queries::Queries::expansion::hefd4b02c09a3d726
  28:     0x7f00b6979189 - rustc_span::with_session_globals::h6569bbb8a4ea9d61
  29:     0x7f00b699e8ff - std::sys_common::backtrace::__rust_begin_short_backtrace::h428dbdd434c4f112
  30:     0x7f00b69757b5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb7785b7f871527db
  31:     0x7f00b46b2bb7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h79456d14677dd3c1
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1575:9
  32:     0x7f00b46b2bb7 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5c40c73501d779c0
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/alloc/src/boxed.rs:1575:9
  33:     0x7f00b46b2bb7 - std::sys::unix::thread::Thread::new::thread_start::h55fc0fe77abc7cf7
                               at /rustc/b663c0f4f6ff84a8c9df0f708e1f8d628330d973/library/std/src/sys/unix/thread.rs:71:17
  34:     0x7f00b43f36db - start_thread
  35:     0x7f00b3d1071f - __clone
  36:                0x0 - <unknown>

Metadata

Metadata

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-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) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions