Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE when importing crate in 2018 edition: directive.imported_module.get() #56125

Closed
tmpolaczyk opened this issue Nov 21, 2018 · 2 comments
Closed
Assignees
Labels
A-resolve Area: Name resolution P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta.

Comments

@tmpolaczyk
Copy link

thread 'main' panicked at 'assertion failed: directive.imported_module.get().is_none()', librustc_resolve/resolve_imports.rs:851:17

Because of the following line:

use actix::prelude::*;

Related: actix/actix#161

The problem is actix::prelude has a module named actix and it causes a conflict with the crate name itself

Minimal example crate:

https://github.com/tmpolaczyk/actix_ice

   Compiling actix_ice v0.1.0 (/home/tomasz/projects/actix_ice)
thread 'main' panicked at 'assertion failed: directive.imported_module.get().is_none()', librustc_resolve/resolve_imports.rs:851:17
stack backtrace:
   0:     0x7f2878744c33 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h620b49fadf2653f7
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x7f287873c318 - std::sys_common::backtrace::_print::h8d76406414198a4a
                               at libstd/sys_common/backtrace.rs:71
   2:     0x7f2878741604 - std::panicking::default_hook::{{closure}}::h2753e227a7b45da6
                               at libstd/sys_common/backtrace.rs:59
                               at libstd/panicking.rs:211
   3:     0x7f287874136d - std::panicking::default_hook::h660245de82f7f01f
                               at libstd/panicking.rs:227
   4:     0x7f2874e75a71 - rustc::util::common::panic_hook::h6d7bcb89f236099f
   5:     0x7f2878741de9 - std::panicking::rust_panic_with_hook::ha639f3e2142547ff
                               at libstd/panicking.rs:480
   6:     0x7f28779e8437 - std::panicking::begin_panic::ha3da65e061e2cb62
   7:     0x7f28779d2ec9 - rustc_resolve::resolve_imports::ImportResolver::finalize_imports::h285d5302ce08f489
   8:     0x7f2877a42cbc - rustc_resolve::Resolver::resolve_crate::he7aa2b5b6a8d1eef
   9:     0x7f2878a62159 - rustc::util::common::time::h2ab61a2d4448a2c6
  10:     0x7f2878a55743 - rustc_driver::driver::phase_2_configure_and_expand::h69f9579ccecfd0b2
  11:     0x7f2878a4fb1a - rustc_driver::driver::compile_input::h3230a6b57b4ebb33
  12:     0x7f2878b2beb4 - rustc_driver::run_compiler_with_pool::h321cf47dec8431a3
  13:     0x7f2878a86655 - <scoped_tls::ScopedKey<T>>::set::h545945df5034f475
  14:     0x7f2878b2aeda - rustc_driver::run_compiler::h42e73d4126dd1a95
  15:     0x7f2878a9e498 - syntax::with_globals::hf4e7008e8602f431
  16:     0x7f287875f049 - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  17:     0x7f2878b28f95 - rustc_driver::run::hbcb28c5139e6c00f
  18:     0x7f2878b36b1b - rustc_driver::main::h5e64003027b9f5c5
  19:     0x55c3a390f962 - std::rt::lang_start::{{closure}}::hef68d8e211d83376
  20:     0x7f2878741712 - std::panicking::try::do_call::h704d683257f21b11
                               at libstd/rt.rs:59
                               at libstd/panicking.rs:310
  21:     0x7f287875f049 - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  22:     0x7f28787421a3 - std::rt::lang_start_internal::hb07e8289ccfeb1cc
                               at libstd/panicking.rs:289
                               at libstd/panic.rs:398
                               at libstd/rt.rs:58
  23:     0x55c3a390f954 - main
  24:     0x7f2878523b16 - __libc_start_main
  25:     0x55c3a390f808 - <unknown>
query stack during panic:
end of query stack

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.32.0-nightly (f1e2fa8f0 2018-11-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

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

error: Could not compile `actix_ice`.

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

Affects beta and nightly.

@petrochenkov petrochenkov self-assigned this Nov 21, 2018
@petrochenkov petrochenkov added A-resolve Area: Name resolution P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Nov 21, 2018
@petrochenkov petrochenkov added this to the Rust 2018 Release milestone Nov 21, 2018
@petrochenkov
Copy link
Contributor

This is a regression from #56042, I'll try to investigate/fix this today.

@petrochenkov
Copy link
Contributor

Fixed in #56147

@petrochenkov petrochenkov removed this from the Rust 2018 Release milestone Nov 21, 2018
bors added a commit that referenced this issue Nov 22, 2018
resolve: Fix some asserts in import validation

The asserts are not actually correct in presence of ambiguity errors.

Fixes #56125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta.
Projects
None yet
Development

No branches or pull requests

2 participants