error: internal compiler error: compiler/rustc_passes/src/dead.rs:122:13: no type-dependent def for method · Issue #88643 · rust-lang/rust (original) (raw)

Code

I'm too new to rust to know what part of this project is causing the compiler to crash, so I made a branch for it and removed the dependency on fltk. https://github.com/battjt/cb-test/blob/rustc_bug/src/main.rs

Meta

Same failure in nightly, beta, and stable
rustc --version --verbose:

joe@think:~/cb-test$ rustc --version --verbose
rustc 1.55.0-beta.9 (27e88d367 2021-08-28)
binary: rustc
commit-hash: 27e88d367c140907655bae9c7975fac411a5c344
commit-date: 2021-08-28
host: x86_64-unknown-linux-gnu
release: 1.55.0-beta.9
LLVM version: 12.0.1
joe@think:~/cb-test$ rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.54.0 (a178d0322 2021-07-26)

joe@think:~/cb-test$ rustc --version --verbose
rustc 1.54.0 (a178d0322 2021-07-26)
binary: rustc
commit-hash: a178d0322ce20e33eac124758e837cbd80a6f633
commit-date: 2021-07-26
host: x86_64-unknown-linux-gnu
release: 1.54.0
LLVM version: 12.0.1
joe@think:~/cb-test$

Error output

joe@think:~/cb-test$ RUST_BACKTRACE=1 cargo run
   Compiling cb-test v0.1.0 (/home/joe/cb-test)
error: internal compiler error: compiler/rustc_passes/src/dead.rs:122:13: no type-dependent def for method

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1034:9
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:🐛:opt_span_bug_fmt
   6: rustc_middle::util:🐛:bug_fmt
   7: <rustc_passes:😵:MarkSymbolVisitor as rustc_hir::intravisit::Visitor>::visit_expr
   8: rustc_hir::intravisit::walk_expr
   9: rustc_hir::intravisit::walk_fn
  10: rustc_hir::intravisit::walk_impl_item
  11: rustc_passes:😵:check_crate
  12: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  13: rustc_session::utils::<impl rustc_session::session::Session>::time
  14: rustc_interface::passes::analysis
  15: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::force_query_with_job
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  22: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  23: rustc_span::with_source_map
  24: rustc_interface::interface::create_compiler_and_run
  25: 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.55.0-beta.9 (27e88d367 2021-08-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

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

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `cb-test`