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

cargo fix --edition crashes with internal compiler error #90523

Closed
joshhansen opened this issue Nov 3, 2021 · 2 comments
Closed

cargo fix --edition crashes with internal compiler error #90523

joshhansen opened this issue Nov 3, 2021 · 2 comments
Labels
A-edition-2021 Area: The 2021 edition 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

@joshhansen
Copy link

joshhansen commented Nov 3, 2021

Just working on updating some old code from 2018 to 2021 edition. It appears to involve this dependency (a fork of the main synth crate) and ran into this error. Reporting as requested in the error output.

Code

Minimum example:

git clone https://github.com/joshhansen/Umpire
cd Umpire
git checkout 75cae7fe5cce1c2cbc7eaa4df4c9039a379e88ce
cargo fix --edition

Meta

rustc --version --verbose:

rustc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-unknown-linux-gnu
release: 1.56.1
LLVM version: 13.0.0

Error output

   Migrating src/lib.rs from 2018 edition to 2021
error: internal compiler error: compiler/rustc_traits/src/normalize_erasing_regions.rs:54:32: could not fully normalize `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1147:9
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.56.1 (59eed8a2a 2021-11-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`
#1 [adt_significant_drop_tys] computing when `synth::Synth` has a significant destructor
end of query stack
error: could not compile `umpire`
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1147:9
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.56.1 (59eed8a2a 2021-11-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`
#1 [adt_significant_drop_tys] computing when `synth::Synth` has a significant destructor
end of query stack
error: build failed

Backtrace

   Migrating src/lib.rs from 2018 edition to 2021
error: internal compiler error: compiler/rustc_traits/src/normalize_erasing_regions.rs:54:32: could not fully normalize `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1147: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::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_infer::infer::InferCtxtBuilder::enter
   8: core::ops::function::FnOnce::call_once
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  10: rustc_data_structures::stack::ensure_sufficient_stack
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::normalize_generic_arg_after_erasing_regions
  13: rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder::normalize_generic_arg_after_erasing_regions
  14: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFolder>::fold_ty
  15: <rustc_ty_utils::needs_drop::NeedsDropTypes<F> as core::iter::traits::iterator::Iterator>::next
  16: <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::next
  17: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  18: core::iter::adapters::process_results
  19: rustc_ty_utils::needs_drop::adt_significant_drop_tys
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::force_query_with_job
  23: rustc_query_system::query::plumbing::get_query_impl
  24: rustc_query_system::query::plumbing::get_query
  25: rustc_ty_utils::needs_drop::has_significant_drop_raw
  26: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  27: rustc_data_structures::stack::ensure_sufficient_stack
  28: rustc_query_system::query::plumbing::get_query_impl
  29: rustc_query_system::query::plumbing::get_query
  30: rustc_middle::ty::util::<impl rustc_middle::ty::TyS>::has_significant_drop
  31: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::analyze_closure
  32: rustc_hir::intravisit::walk_expr
  33: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  34: rustc_hir::intravisit::walk_expr
  35: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  36: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::closure_analyze
  37: rustc_infer::infer::InferCtxtBuilder::enter
  38: rustc_typeck::check::typeck
  39: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  40: rustc_data_structures::stack::ensure_sufficient_stack
  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>::typeck
  44: rustc_typeck::check::typeck
  45: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  46: rustc_data_structures::stack::ensure_sufficient_stack
  47: rustc_query_system::query::plumbing::force_query_with_job
  48: rustc_query_system::query::plumbing::get_query_impl
  49: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  50: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  51: rustc_typeck::check::typeck_item_bodies
  52: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  53: rustc_query_system::query::plumbing::force_query_with_job
  54: rustc_query_system::query::plumbing::get_query_impl
  55: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  56: rustc_session::utils::<impl rustc_session::session::Session>::time
  57: rustc_typeck::check_crate
  58: rustc_interface::passes::analysis
  59: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  60: rustc_data_structures::stack::ensure_sufficient_stack
  61: rustc_query_system::query::plumbing::force_query_with_job
  62: rustc_query_system::query::plumbing::get_query_impl
  63: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  64: rustc_interface::passes::QueryContext::enter
  65: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  66: rustc_span::with_source_map
  67: 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.56.1 (59eed8a2a 2021-11-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`
#1 [adt_significant_drop_tys] computing when `synth::Synth` has a significant destructor
#2 [has_significant_drop_raw] computing whether `synth::Synth<synth::instrument::mode::Poly, (), synth::oscillator::waveform::Square, synth::Envelope, synth::Envelope, ()>` has a significant drop
#3 [typeck] type-checking `ui::audio::play_sounds`
#4 [typeck] type-checking `ui::audio::play_sounds::{closure#0}`
#5 [typeck_item_bodies] type-checking all item bodies
#6 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `umpire`
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1147: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::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_infer::infer::InferCtxtBuilder::enter
   8: core::ops::function::FnOnce::call_once
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  10: rustc_data_structures::stack::ensure_sufficient_stack
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::normalize_generic_arg_after_erasing_regions
  13: rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder::normalize_generic_arg_after_erasing_regions
  14: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFolder>::fold_ty
  15: <rustc_ty_utils::needs_drop::NeedsDropTypes<F> as core::iter::traits::iterator::Iterator>::next
  16: <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::next
  17: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  18: core::iter::adapters::process_results
  19: rustc_ty_utils::needs_drop::adt_significant_drop_tys
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::force_query_with_job
  23: rustc_query_system::query::plumbing::get_query_impl
  24: rustc_query_system::query::plumbing::get_query
  25: rustc_ty_utils::needs_drop::has_significant_drop_raw
  26: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  27: rustc_data_structures::stack::ensure_sufficient_stack
  28: rustc_query_system::query::plumbing::get_query_impl
  29: rustc_query_system::query::plumbing::get_query
  30: rustc_middle::ty::util::<impl rustc_middle::ty::TyS>::has_significant_drop
  31: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::analyze_closure
  32: rustc_hir::intravisit::walk_expr
  33: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  34: rustc_hir::intravisit::walk_expr
  35: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  36: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::closure_analyze
  37: rustc_infer::infer::InferCtxtBuilder::enter
  38: rustc_typeck::check::typeck
  39: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  40: rustc_data_structures::stack::ensure_sufficient_stack
  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>::typeck
  44: rustc_typeck::check::typeck
  45: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  46: rustc_data_structures::stack::ensure_sufficient_stack
  47: rustc_query_system::query::plumbing::force_query_with_job
  48: rustc_query_system::query::plumbing::get_query_impl
  49: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  50: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  51: rustc_typeck::check::typeck_item_bodies
  52: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  53: rustc_query_system::query::plumbing::force_query_with_job
  54: rustc_query_system::query::plumbing::get_query_impl
  55: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  56: rustc_session::utils::<impl rustc_session::session::Session>::time
  57: rustc_typeck::check_crate
  58: rustc_interface::passes::analysis
  59: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  60: rustc_data_structures::stack::ensure_sufficient_stack
  61: rustc_query_system::query::plumbing::force_query_with_job
  62: rustc_query_system::query::plumbing::get_query_impl
  63: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  64: rustc_interface::passes::QueryContext::enter
  65: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  66: rustc_span::with_source_map
  67: 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.56.1 (59eed8a2a 2021-11-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq>`
#1 [adt_significant_drop_tys] computing when `synth::Synth` has a significant destructor
#2 [has_significant_drop_raw] computing whether `synth::Synth<synth::instrument::mode::Poly, (), synth::oscillator::waveform::Square, synth::Envelope, synth::Envelope, ()>` has a significant drop
#3 [typeck] type-checking `ui::audio::play_sounds`
#4 [typeck] type-checking `ui::audio::play_sounds::{closure#0}`
#5 [typeck_item_bodies] type-checking all item bodies
#6 [analysis] running analysis passes on this crate
end of query stack
error: build failed

@joshhansen joshhansen 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 Nov 3, 2021
@joshhansen joshhansen changed the title error: internal compiler error: compiler/rustc_traits/src/normalize_erasing_regions.rs:54:32: could not fully normalize synth::instrument::Voice<<std::alloc::Global as synth::instrument::NoteFreqGenerator>::NoteFreq> cargo edition --fix crashes with internal compiler error Nov 3, 2021
@joshhansen joshhansen changed the title cargo edition --fix crashes with internal compiler error cargo fix --edition crashes with internal compiler error Nov 3, 2021
@ehuss
Copy link
Contributor

ehuss commented Nov 3, 2021

Thanks for the report! I believe this is a duplicate of #90140, which should now be fixed on nightly via #90218. If you can, try the nightly channel, and if you continue to have issues, feel free to reopen.

@ehuss ehuss closed this as completed Nov 3, 2021
@ehuss ehuss added the A-edition-2021 Area: The 2021 edition label Nov 3, 2021
@joshhansen
Copy link
Author

Appears to be working on nightly, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition 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