Skip to content

ICE: thread 'rustc' panicked at 'called Option::unwrap() on a None value', compiler/rustc_metadata/src/rmeta/decoder.rs:945:54 #78922

Closed
@chengniansun

Description

@chengniansun

Code

fn main() {
    std::<0>
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (25f6938da 2020-11-09)
binary: rustc
commit-hash: 25f6938da459a57b43bdf16ed6bdad3225b2a3ce
commit-date: 2020-11-09
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly

Error output

error[E0423]: expected value, found crate `std`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:5
  |
2 |     std::<0>
  |     ^^^^^^^^ not a value

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:945:54
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.49.0-nightly (25f6938da 2020-11-09) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [generics_of] computing generics of `std`
#1 [opt_const_param_of] computing the optional const parameter of `main::{constant#0}`
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0423`.
Backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:945:54
stack backtrace:
   0: rust_begin_unwind
             at /rustc/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at /rustc/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/library/core/src/panicking.rs:50:5
   3: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_generics
   4: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::generics_of
   5: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::generics_of>::compute
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::get_query_impl
   9: rustc_typeck::collect::type_of::opt_const_param_of
  10: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::opt_const_param_of>::compute
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  12: rustc_data_structures::stack::ensure_sufficient_stack
  13: rustc_query_system::query::plumbing::get_query_impl
  14: rustc_typeck::check::typeck
  15: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck>::compute
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::get_query_impl
  19: rustc_query_system::query::plumbing::ensure_query_impl
  20: rustc_typeck::check::typeck_item_bodies
  21: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_item_bodies>::compute
  22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  23: rustc_data_structures::stack::ensure_sufficient_stack
  24: rustc_query_system::query::plumbing::get_query_impl
  25: rustc_typeck::check_crate
  26: rustc_interface::passes::analysis
  27: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  28: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  29: rustc_data_structures::stack::ensure_sufficient_stack
  30: rustc_query_system::query::plumbing::get_query_impl
  31: rustc_interface::passes::QueryContext::enter
  32: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  33: rustc_span::with_source_map
  34: rustc_interface::interface::create_compiler_and_run
  35: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metadataArea: Crate metadataC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions