Skip to content

Rustc panic: Option::unwrap() on None at src/librustc/hir/mod.rs:81:37 #70124

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

Closed
ChrisGreenaway opened this issue Mar 18, 2020 · 1 comment
Closed
Labels
C-bug Category: This is a bug. 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

@ChrisGreenaway
Copy link

ChrisGreenaway commented Mar 18, 2020

Code

Sorry to not provide something more precise, but this was reported to me by Travis here: https://travis-ci.com/github/ChrisGreenaway/cargo-local-registry/jobs/299634154

You can reproduce it with:

git clone https://github.com/ChrisGreenaway/cargo-local-registry.git
cd cargo-local-registry
cargo +nightly build

But it looks like the problem was caused by some code in the docopt crate.

Meta

rustc --version --verbose:

$ rustc +nightly --version --verbose
rustc 1.44.0-nightly (7ceebd98c 2020-03-17)
binary: rustc
commit-hash: 7ceebd98c6a15ae30e772eebb676b63ffa1a8122
commit-date: 2020-03-17
host: x86_64-pc-windows-msvc
release: 1.44.0-nightly
LLVM version: 9.0

Error output

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 (7ceebd98c 2020-03-17) running on x86_64-pc-windows-msvc

note: compiler flags: -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...
error: build failed

Backtrace

$ cargo +nightly build
   Compiling docopt v1.1.0
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src\librustc\hir\mod.rs:81:37
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: <std::io::IoSlice as core::fmt::Debug>::fmt
   3: std::panicking::take_hook
   4: std::panicking::take_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic
  10: rustc::ty::structural_impls::<impl rustc::ty::context::Lift for rustc_span::span_encoding::Span>::lift_to_tcx
  11: rustc::ty::<impl rustc::ty::context::TyCtxt>::is_object_safe
  12: rustc::dep_graph::graph::DepGraph::assert_ignored
  13: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack
  14: rustc::hir::map::Map::find_entry
  15: rustc::hir::map::Map::find
  16: <rustc_passes::upvars::CaptureCollector as rustc_hir::intravisit::Visitor>::visit_expr
  17: <rustc_passes::weak_lang_items::Context as rustc_hir::intravisit::Visitor>::visit_foreign_item
  18: rustc_passes::dead::check_crate
  19: rustc_interface::interface::parse_cfgspecs
  20: rustc_interface::queries::Linker::link
  21: rustc_interface::passes::QueryContext::print_stats
  22: rustc_errors::snippet::MultilineAnnotation::increase_depth
  23: <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs
  24: <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs
  25: <rustc_driver::args::Error as core::fmt::Debug>::fmt
  26: <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs
  27: <rustc_driver::DEFAULT_HOOK as core::ops::deref::Deref>::deref
  28: <alloc::vec::Vec<rustc_ast::ast::Attribute> as rustc_ast::attr::HasAttrs>::attrs
  29: ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error.
.Error$u2b$core..marker..Send$u2b$core..marker..Sync$GT$$GT$..from..StringError$u20$as$u20$core..fmt..Display$GT$3fmt17
  30: std::sys::windows::thread::Thread::new
  31: BaseThreadInitThunk
  32: RtlUserThreadStart
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 (7ceebd98c 2020-03-17) running on x86_64-pc-windows-msvc

note: compiler flags: -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`.

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

@ChrisGreenaway ChrisGreenaway added C-bug Category: This is a bug. 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. labels Mar 18, 2020
@jonas-schievink
Copy link
Contributor

duplicate of #70041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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

2 participants