Skip to content

"inconsistent resolution for an import" with Rust 2018 #56596

Closed
@Thinkofname

Description

@Thinkofname

I was trying to use the 2018 edition with my game and after running cargo fix and then trying to cargo check the result I got the following panic. This only happens if edition = "2018" is set in my Cargo.toml, if its not set it compiles fine. I'm not sure where its crashing so I can't provide a test case yet.

Rustc version: rustc 1.31.0 (abe02cefd 2018-12-04)

Backtrace:

thread 'main' panicked at 'librustc_resolve/resolve_imports.rs:840: inconsistent resolution for an import', librustc/util/bug.rs:47:26
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:480
   6: std::panicking::begin_panic
   7: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   8: rustc::ty::context::tls::with_opt::{{closure}}
   9: rustc::ty::context::tls::with_context_opt
  10: rustc::ty::context::tls::with_opt
  11: rustc::util::bug::opt_span_bug_fmt
  12: rustc::util::bug::span_bug_fmt
  13: rustc_resolve::resolve_imports::ImportResolver::finalize_imports
  14: rustc_resolve::Resolver::resolve_crate
  15: rustc::util::common::time
  16: rustc_driver::driver::phase_2_configure_and_expand
  17: rustc_driver::driver::compile_input
  18: rustc_driver::run_compiler_with_pool
  19: rustc_driver::driver::spawn_thread_pool
  20: rustc_driver::run_compiler
  21: <scoped_tls::ScopedKey<T>>::set
  22: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  23: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  24: rustc_driver::run
  25: rustc_driver::main
  26: std::rt::lang_start::{{closure}}
  27: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  28: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  29: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  30: main
  31: __libc_start_main
  32: <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.31.0 (abe02cefd 2018-12-04) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=1 -C debuginfo=2 -C debug-assertions=on -C incremental -C linker=clang -C link-arg=-fuse-ld=lld --crate-type bin

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

error: Could not compile `univercity`.

Metadata

Metadata

Assignees

Labels

A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyI-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