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: compiler/rustc_metadata/src/rmeta/decoder.rs:1233:18: cannot get associated-item of DefKey { parent: Some(DefIndex(37465)), disambiguated_data: DisambiguatedDefPathData { data: TypeNs("None"), disambiguator: 0 } } #83836

Closed
chengniansun opened this issue Apr 4, 2021 · 6 comments
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

fn func2(_x: Option<Target = Option>) {}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (0b417ab5c 2021-04-03)
binary: rustc
commit-hash: 0b417ab5cdfdedffd74fb22cf22d27033c851304
commit-date: 2021-04-03
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | fn func2(_x: Option<Target = Option>) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:1233:18: cannot get associated-item of `DefKey { parent: Some(DefIndex(37465)), disambiguated_data: DisambiguatedDefPathData { data: TypeNs("None"), disambiguator: 0 } }`

thread 'rustc' panicked at 'Box<Any>', /rustc/0b417ab5cdfdedffd74fb22cf22d27033c851304/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.53.0-nightly (0b417ab5c 2021-04-03) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [associated_item] computing associated item data for `std::prelude::v1::None`
#1 [associated_items] collecting associated items of std::option::Option
end of query stack
error: aborting due to 2 previous errors

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

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | fn func2(_x: Option<Target = Option>) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:1233:18: cannot get associated-item of `DefKey { parent: Some(DefIndex(37465)), disambiguated_data: DisambiguatedDefPathData { data: TypeNs("None"), disambiguator: 0 } }`

thread 'rustc' panicked at 'Box<Any>', /rustc/0b417ab5cdfdedffd74fb22cf22d27033c851304/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_associated_item
   8: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::associated_item
   9: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::associated_item>::compute
  10: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  11: rustc_data_structures::stack::ensure_sufficient_stack
  12: rustc_query_system::query::plumbing::force_query_with_job
  13: rustc_query_system::query::plumbing::get_query_impl
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::associated_item
  15: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  16: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  17: rustc_ty_utils::ty::associated_items
  18: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::associated_items>::compute
  19: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  20: rustc_data_structures::stack::ensure_sufficient_stack
  21: rustc_query_system::query::plumbing::force_query_with_job
  22: rustc_query_system::query::plumbing::get_query_impl
  23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::associated_items
  24: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_path
  25: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_ty
  26: rustc_resolve::late::lifetimes::LifetimeContext::visit_fn_like_elision
  27: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_fn
  28: rustc_hir::intravisit::walk_item
  29: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_item
  30: rustc_resolve::late::lifetimes::do_resolve
  31: rustc_resolve::late::lifetimes::resolve_lifetimes
  32: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_lifetimes>::compute
  33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  34: rustc_data_structures::stack::ensure_sufficient_stack
  35: rustc_query_system::query::plumbing::force_query_with_job
  36: rustc_query_system::query::plumbing::get_query_impl
  37: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolve_lifetimes
  38: rustc_resolve::late::lifetimes::resolve_lifetimes_for
  39: core::ops::function::FnOnce::call_once
  40: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  41: rustc_query_system::query::plumbing::force_query_with_job
  42: rustc_query_system::query::plumbing::get_query_impl
  43: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::late_bound_vars_map
  44: rustc_middle::ty::context::TyCtxt::late_bound_vars
  45: <dyn rustc_typeck::astconv::AstConv>::ty_of_fn
  46: rustc_typeck::collect::fn_sig
  47: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::fn_sig>::compute
  48: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  49: rustc_data_structures::stack::ensure_sufficient_stack
  50: rustc_query_system::query::plumbing::force_query_with_job
  51: rustc_query_system::query::plumbing::get_query_impl
  52: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::fn_sig
  53: rustc_typeck::collect::convert_item
  54: <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_item
  55: rustc_middle::hir::map::Map::visit_item_likes_in_module
  56: rustc_typeck::collect::collect_mod_item_types
  57: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  58: rustc_query_system::query::plumbing::force_query_with_job
  59: rustc_query_system::query::plumbing::get_query_impl
  60: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types
  61: rustc_session::session::Session::track_errors
  62: rustc_typeck::check_crate
  63: rustc_interface::passes::analysis
  64: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  65: rustc_data_structures::stack::ensure_sufficient_stack
  66: rustc_query_system::query::plumbing::force_query_with_job
  67: rustc_query_system::query::plumbing::get_query_impl
  68: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  69: rustc_interface::passes::QueryContext::enter
  70: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  71: rustc_span::with_source_map
  72: rustc_interface::interface::create_compiler_and_run
  73: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.53.0-nightly (0b417ab5c 2021-04-03) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [associated_item] computing associated item data for `std::prelude::v1::None`
#1 [associated_items] collecting associated items of std::option::Option
#2 [resolve_lifetimes] resolving lifetimes
#3 [late_bound_vars_map] looking up late bound vars
#4 [fn_sig] computing function signature of `func2`
#5 [collect_mod_item_types] collecting item types in top-level module
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors

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

@chengniansun chengniansun 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 Apr 4, 2021
@SNCPlay42
Copy link
Contributor

SNCPlay42 commented Apr 4, 2021

Output on stable 1.51 and beta:

error[E0107]: missing generics for enum `Option`
   --> <source>:1:14
    |
1   | fn func2(_x: Option<Target = Option>) {}
    |              ^^^^^^ expected 1 type argument
    |
note: enum defined here, with 1 type parameter: `T`
help: use angle brackets to add missing type argument
    |
1   | fn func2(_x: Option<T><Target = Option>) {}
    |                    ^^^

error[E0107]: missing generics for enum `Option`
   --> <source>:1:30
    |
1   | fn func2(_x: Option<Target = Option>) {}
    |                              ^^^^^^ expected 1 type argument
    |
note: enum defined here, with 1 type parameter: `T`
help: use angle brackets to add missing type argument
    |
1   | fn func2(_x: Option<Target = Option<T>>) {}
    |                                    ^^^

error[E0229]: associated type bindings are not allowed here
 --> <source>:1:21
  |
1 | fn func2(_x: Option<Target = Option>) {}
  |                     ^^^^^^^^^^^^^^^ associated type not allowed here

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0107, E0229.
For more information about an error, try `rustc --explain E0107`.

searched nightlies: from nightly-2021-03-20 to nightly-2021-04-04
regressed nightly: nightly-2021-04-01
searched commits: from 74874a6 to 4fdac23
regressed commit: 4fdac23 (#76814)

bisected with cargo-bisect-rustc v0.6.0

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --preserve --regress=ice --start=2021-03-20 -- check 

@rustbot label regression-from-stable-to-nightly

@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 4, 2021
@SNCPlay42
Copy link
Contributor

This looks very similar to #83753.

@apiraino
Copy link
Contributor

apiraino commented Apr 6, 2021

Also, bisection of #83753 points to the same commit: could this issue be a duplicate?

@apiraino
Copy link
Contributor

apiraino commented Apr 6, 2021

Assigning priority as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 6, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Apr 9, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 10, 2021
@wfxr
Copy link

wfxr commented Apr 14, 2021

Repro in another slight different form on nightly-2021-04-13:

echo 'fn foo() -> std::iter::Map<Item = i32> { unimplemented!() }' | rustc - --crate-type=lib

Error output:

error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:1233:18: cannot get associated-item of `DefKey { parent: Some(DefIndex(38829)), disambiguated_data: DisambiguatedDefPathData { data: ValueNs("iter"), disambiguator: 0 } }`

thread 'rustc' panicked at 'Box<Any>', /rustc/132b4e5d167b7e622fcc11fa2b67b931105b4de1/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.53.0-nightly (132b4e5d1 2021-04-13) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

query stack during panic:
#0 [associated_item] computing associated item data for `std::iter::Map::iter`
#1 [associated_items] collecting associated items of std::iter::Map
end of query stack
error: aborting due to previous error

@JohnTitor
Copy link
Member

Triage: Fixed by #83944, I'm going to close this as that PR should have a regression test for this issue.

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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

7 participants