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

thread 'rustc' panicked at 'called Option::unwrap() on a None value', src/librustc/hir/mod.rs:81:37 #70599

Closed
XVilka opened this issue Mar 31, 2020 · 5 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-HIR Area: The high-level intermediate representation (HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@XVilka
Copy link

XVilka commented Mar 31, 2020

OS: Fedora 31, amd64
Rust version is rustc 1.44.0-nightly (f509b26a7 2020-03-18)

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc/hir/mod.rs:81:37
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=4 -C debuginfo=2 --crate-type lib

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

error: could not compile `docopt`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...

With backtrace enabled:

[i] ℤ RUST_BACKTRACE=1 cargo build                                                                                                                                                                                   12:46:09 via 𝗥 v1.44.0 
   Compiling docopt v1.1.0
   Compiling radeco v0.1.0 (/home/akochkov/radare/radeco/radeco)
   Compiling cookie_store v0.7.0
   Compiling onig_sys v69.2.0
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc/hir/mod.rs:81:37
stack backtrace:
   Compiling reqwest v0.9.22
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1427
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:515
  12: rust_begin_unwind
             at src/libstd/panicking.rs:419
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  14: core::panicking::panic
             at src/libcore/panicking.rs:54
  15: core::ops::function::FnOnce::call_once
  16: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::hir_owner>::compute
  17: rustc::dep_graph::graph::DepGraph::with_task_impl
  18: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  19: rustc::hir::map::Map::get_entry
  20: rustc::hir::map::Map::find
  21: rustc_passes::dead::MarkSymbolVisitor::check_def_id
  22: rustc_hir::intravisit::walk_item
  23: rustc_passes::dead::check_crate
  24: rustc_session::utils::<impl rustc_session::session::Session>::time
  25: rustc_interface::passes::analysis::{{closure}}::{{closure}}
  26: rustc_session::utils::<impl rustc_session::session::Session>::time
  27: rustc_interface::passes::analysis
  28: rustc::ty::query::__query_compute::analysis
  29: rustc::dep_graph::graph::DepGraph::with_task_impl
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  31: rustc::ty::context::tls::enter_global
  32: rustc_interface::interface::run_compiler_in_existing_thread_pool
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=4 -C debuginfo=2 --crate-type lib

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

query stack during panic:
#0 [hir_owner] processing `regex`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `docopt`.
@DanSnow
Copy link

DanSnow commented Mar 31, 2020

minimal reproduce:

macro_rules! regex(
    () => ();
);

#[allow(dead_code)]
mod foo {
    use regex;
}

fn main() {}

@Centril Centril added A-frontend Area: Compiler frontend (errors, parsing and HIR) A-HIR Area: The high-level intermediate representation (HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-nominated labels Mar 31, 2020
@Centril
Copy link
Contributor

Centril commented Mar 31, 2020

@DanSnow I cannot get that to ICE in the playground. How are you testing this?

@DanSnow
Copy link

DanSnow commented Mar 31, 2020

@Centril

$ rustup toolchain install nightly-2020-03-18 --profile minimal
$ cargo new foo
$ cd foo
$ # paste above code into src/main.rs
$ cargo +nightly-2020-03-18 b

@DanSnow
Copy link

DanSnow commented Mar 31, 2020

@Centril Sorry, I just try it with nightly-2020-03-30 and this error cannot reproducible

@matthiaskrgr
Copy link
Member

looks like a dupe of #70041

@Centril Centril closed this as completed Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-HIR Area: The high-level intermediate representation (HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants