Skip to content

Impossible case reached: src/librustc_ty/needs_drop.rs:111 #72685

Closed

Description

I can't share the code, but I have a commit at which problem surfaced in case I need to check it again.

With rustc 1.45.0-nightly (664fcd3 2020-05-27):

error: internal compiler error: src/librustc_ty/needs_drop.rs:110: impossible case reached

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
stack backtrace:
   0:        0x1158b7e5e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::haddd67525bfc5efd
   1:        0x1158f14ac - core::fmt::write::h26bd57c1fd6e9c98
   2:        0x1158a9367 - std::io::Write::write_fmt::he98312d4cdda2998
   3:        0x1158bc995 - std::panicking::default_hook::{{closure}}::h972739288f683b01
   4:        0x1158bc6d2 - std::panicking::default_hook::hb37535587742c590
   5:        0x10ea6c318 - rustc_driver::report_ice::h7e82cb45a804e7ac
   6:        0x1158bcfe5 - std::panicking::rust_panic_with_hook::h282a3815a0dbd960
   7:        0x112e22836 - std::panicking::begin_panic::h3347aa79e2bd0001
   8:        0x112a2bb47 - rustc_errors::HandlerInner::bug::hdd3d3d4df8ecc812
   9:        0x112a2a587 - rustc_errors::Handler::bug::hfdb40f11e1ec6375
  10:        0x11268b8d9 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h672ee7bf29d2e585
  11:        0x112683856 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h180e0d128cf5a691
  12:        0x1126837db - rustc_middle::ty::context::tls::with_opt::h3dd865e1673fd5c3
  13:        0x11268b7e8 - rustc_middle::util::bug::opt_span_bug_fmt::h11c4561b989ea294
  14:        0x112e0a25b - rustc_middle::util::bug::bug_fmt::heb0671f45a3fced7
  15:        0x110b86245 - rustc_ty::needs_drop::needs_drop_raw::h5f1b2d46b1fe1310
  16:        0x1115197e2 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::needs_drop_raw>::compute::hfebf1463447e93e9
  17:        0x11146e167 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h408ef90e215ff458
  18:        0x1117d23eb - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h6ad91f3c6bd1184b
  19:        0x111748941 - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::h78d6d7ad62a98123
  20:        0x1116f6f6c - rustc_query_system::query::plumbing::get_query_impl::hb404b598357f155e
  21:        0x11151913f - rustc_middle::ty::util::<impl rustc_middle::ty::TyS>::needs_drop::hec2a1d98b017a984
  22:        0x11153e633 - rustc_mir::dataflow::drop_flag_effects::on_all_children_bits::on_all_children_bits::h945d86a5f582fc5a
  23:        0x111893af1 - <rustc_mir::transform::elaborate_drops::ElaborateDrops as rustc_mir::transform::MirPass>::run_pass::h6ddb718a55e42b2e
  24:        0x11189cdf6 - rustc_mir::transform::run_passes::hae0f8213abc898bd
  25:        0x11189e4a8 - rustc_mir::transform::run_optimization_passes::h8d4e073ac16d4b4a
  26:        0x11189e797 - rustc_mir::transform::optimized_mir::hed469a7ecc9c2f75
  27:        0x111b4d5db - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir>::compute::h8fda8cd262fe2387
  28:        0x111c34e94 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h9e4689433b3bec8a
  29:        0x111cdba42 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::he4a31e2f27add82c
  30:        0x111ce4614 - rustc_data_structures::stack::ensure_sufficient_stack::hc6d3d3b43db324d6
  31:        0x111ca880e - rustc_query_system::query::plumbing::get_query_impl::haec7a438c772d019
  32:        0x111b5ea39 - rustc_metadata::rmeta::encoder::EncodeContext::encode_optimized_mir::h36ec3fe0bfcce890
  33:        0x111b5f7d9 - <rustc_metadata::rmeta::encoder::EncodeContext as rustc_hir::intravisit::Visitor>::visit_expr::hfcf00eaa21e37df6
  34:        0x111d0a04f - rustc_hir::intravisit::walk_expr::he05489e90d3f9167
  35:        0x111b5f4ca - <rustc_metadata::rmeta::encoder::EncodeContext as rustc_hir::intravisit::Visitor>::visit_expr::hfcf00eaa21e37df6
  36:        0x111d099d5 - rustc_hir::intravisit::walk_fn::hdba1b43e9f186e02
  37:        0x111d0a7f2 - rustc_hir::intravisit::walk_item::h671e77f4156655d5
  38:        0x111b5fd8f - <rustc_metadata::rmeta::encoder::EncodeContext as rustc_hir::intravisit::Visitor>::visit_item::h16757bad83b9ba4c
  39:        0x111c55706 - rustc_hir::hir::Crate::visit_all_item_likes::h06250e40e6b25714
  40:        0x111b679d5 - rustc_metadata::rmeta::encoder::encode_metadata_impl::hf580f14b5e5ed365
  41:        0x111c4b7b9 - rustc_data_structures::sync::join::he6c503409ba48db1
  42:        0x111b9ba93 - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::encode_metadata::h2a4dc82724a70bb8
  43:        0x112682254 - rustc_middle::ty::context::TyCtxt::encode_metadata::hcbc9b148077f4a74
  44:        0x10ebbfcb4 - rustc_interface::passes::start_codegen::h566b590c93aad30d
  45:        0x10ebceae8 - rustc_middle::ty::context::tls::enter_global::h3137fb999bf26770
  46:        0x10ebc9b1b - rustc_interface::queries::Queries::ongoing_codegen::h1a6016b31f7ff214
  47:        0x10ea36752 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h5e937ba6fd9f8f01
  48:        0x10ea7c9a5 - rustc_ast::attr::with_globals::hcdba3f2dccfd96ec
  49:        0x10ea7db89 - std::sys_common::backtrace::__rust_begin_short_backtrace::h530da67482db7b0b
  50:        0x10ea3951c - core::ops::function::FnOnce::call_once{{vtable.shim}}::hdb3c595dbde36cc1
  51:        0x1158cb0dd - std::sys::unix::thread::Thread::new::thread_start::h7f9271978e0efa0c
  52:     0x7fff70077109 - _ZL12preoptimized

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0-nightly (664fcd3f0 2020-05-27) running on x86_64-apple-darwin

note: compiler flags: -C panic=abort -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 [needs_drop_raw] computing whether `std::future::from_generator::GenFuture<[static generator@src/peer/coordinator.rs:129:21: 161:2 ctx:[type error], stream:[type error], buf:[type error], peers:[type error], server:[type error] [type error]]>` needs drop
#1 [optimized_mir] processing `peer::coordinator::relay::{{closure}}#0`
end of query stack
error: aborting due to previous error

error: could not compile `MY_CRATE`.

To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-coroutinesArea: CoroutinesAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions