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_ty_utils/src/ty.rs:209:14: associated_item_def_ids: not impl or trait #83753

Closed
chengniansun opened this issue Apr 1, 2021 · 3 comments · Fixed by #83944
Assignees
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

struct NodeRef {}
impl Handle {
  fn new_kv ( node : NodeRef <Target = >) {}
}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (4fdac23f3 2021-03-31)
binary: rustc
commit-hash: 4fdac23f3171e2f8864d359a21da600dd3faafc9
commit-date: 2021-03-31
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error: missing type to the right of `=`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:39
  |
3 |   fn new_kv ( node : NodeRef <Target = >) {}
  |                                       ^
  |
help: to constrain the associated type, add a type after `=`
  |
3 |   fn new_kv ( node : NodeRef <Target = TheType>) {}
  |                                        ^^^^^^^
help: remove the `=` if `Target` is a type
  |
3 |   fn new_kv ( node : NodeRef <Target >) {}
  |                                     --

error[E0412]: cannot find type `Handle` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:6
  |
2 | impl Handle {
  |      ^^^^^^ not found in this scope

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 | / struct NodeRef {}
2 | | impl Handle {
3 | |   fn new_kv ( node : NodeRef <Target = >) {}
4 | | }
  | |_^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_ty_utils/src/ty.rs:209:14: associated_item_def_ids: not impl or trait
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | struct NodeRef {}
  | ^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', /rustc/4fdac23f3171e2f8864d359a21da600dd3faafc9/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 (4fdac23f3 2021-03-31) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [associated_item_def_ids] collecting associated items of `NodeRef`
#1 [associated_items] collecting associated items of NodeRef
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0412, E0601.
For more information about an error, try `rustc --explain E0412`.
Backtrace

error: missing type to the right of `=`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:39
  |
3 |   fn new_kv ( node : NodeRef <Target = >) {}
  |                                       ^
  |
help: to constrain the associated type, add a type after `=`
  |
3 |   fn new_kv ( node : NodeRef <Target = TheType>) {}
  |                                        ^^^^^^^
help: remove the `=` if `Target` is a type
  |
3 |   fn new_kv ( node : NodeRef <Target >) {}
  |                                     --

error[E0412]: cannot find type `Handle` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:6
  |
2 | impl Handle {
  |      ^^^^^^ not found in this scope

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 | / struct NodeRef {}
2 | | impl Handle {
3 | |   fn new_kv ( node : NodeRef <Target = >) {}
4 | | }
  | |_^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_ty_utils/src/ty.rs:209:14: associated_item_def_ids: not impl or trait
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | struct NodeRef {}
  | ^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', /rustc/4fdac23f3171e2f8864d359a21da600dd3faafc9/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::span_bug
   3: rustc_errors::Handler::span_bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::span_bug_fmt
   7: rustc_ty_utils::ty::associated_item_def_ids
   8: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   9: rustc_data_structures::stack::ensure_sufficient_stack
  10: rustc_query_system::query::plumbing::force_query_with_job
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::associated_item_def_ids
  13: rustc_ty_utils::ty::associated_items
  14: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::associated_items>::compute
  15: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  16: rustc_data_structures::stack::ensure_sufficient_stack
  17: rustc_query_system::query::plumbing::force_query_with_job
  18: rustc_query_system::query::plumbing::get_query_impl
  19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::associated_items
  20: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_path
  21: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_ty
  22: rustc_resolve::late::lifetimes::LifetimeContext::visit_fn_like_elision
  23: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_fn
  24: rustc_hir::intravisit::walk_impl_item
  25: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_impl_item
  26: rustc_hir::intravisit::walk_item
  27: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_item
  28: rustc_resolve::late::lifetimes::do_resolve
  29: rustc_resolve::late::lifetimes::resolve_lifetimes
  30: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_lifetimes>::compute
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_data_structures::stack::ensure_sufficient_stack
  33: rustc_query_system::query::plumbing::force_query_with_job
  34: rustc_query_system::query::plumbing::get_query_impl
  35: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolve_lifetimes
  36: rustc_resolve::late::lifetimes::resolve_lifetimes_for
  37: core::ops::function::FnOnce::call_once
  38: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  39: rustc_query_system::query::plumbing::force_query_with_job
  40: rustc_query_system::query::plumbing::get_query_impl
  41: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::late_bound_vars_map
  42: rustc_middle::ty::context::TyCtxt::late_bound_vars
  43: <dyn rustc_typeck::astconv::AstConv>::ty_of_fn
  44: rustc_typeck::collect::fn_sig
  45: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::fn_sig>::compute
  46: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  47: rustc_data_structures::stack::ensure_sufficient_stack
  48: rustc_query_system::query::plumbing::force_query_with_job
  49: rustc_query_system::query::plumbing::get_query_impl
  50: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::fn_sig
  51: <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_impl_item
  52: rustc_middle::hir::map::Map::visit_item_likes_in_module
  53: rustc_typeck::collect::collect_mod_item_types
  54: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  55: rustc_query_system::query::plumbing::force_query_with_job
  56: rustc_query_system::query::plumbing::get_query_impl
  57: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types
  58: rustc_session::session::Session::track_errors
  59: rustc_typeck::check_crate
  60: rustc_interface::passes::analysis
  61: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  62: rustc_data_structures::stack::ensure_sufficient_stack
  63: rustc_query_system::query::plumbing::force_query_with_job
  64: rustc_query_system::query::plumbing::get_query_impl
  65: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  66: rustc_interface::passes::QueryContext::enter
  67: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  68: rustc_span::with_source_map
  69: rustc_interface::interface::create_compiler_and_run
  70: 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 (4fdac23f3 2021-03-31) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [associated_item_def_ids] collecting associated items of `NodeRef`
#1 [associated_items] collecting associated items of NodeRef
#2 [resolve_lifetimes] resolving lifetimes
#3 [late_bound_vars_map] looking up late bound vars
#4 [fn_sig] computing function signature of `<impl at perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:1: 4:2>::new_kv`
#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 4 previous errors

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

@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 1, 2021
@jonas-schievink jonas-schievink added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 1, 2021
@JohnTitor JohnTitor added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Apr 1, 2021
@JohnTitor
Copy link
Member

JohnTitor commented Apr 1, 2021

Bisected: caused by #76814, cc @jackh726

@JohnTitor
Copy link
Member

JohnTitor commented Apr 1, 2021

Slightly simplified (getting rid of unrelated compile errors):

struct Foo {}
impl Foo {
    fn bar(foo: Foo<Target = usize>) {}
}
fn main() {}

@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

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

Successfully merging a pull request may close this issue.

7 participants