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: Can't hash a TyVid (const generics???) #62700

Closed
DutchGhost opened this issue Jul 15, 2019 · 4 comments
Closed

ICE: Can't hash a TyVid (const generics???) #62700

DutchGhost opened this issue Jul 15, 2019 · 4 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-const_generics `#![feature(const_generics)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@DutchGhost
Copy link
Contributor

I'm not sure if this happens due to const generics, but while working on a codebase I stumbled upon this ICE multiple times:

Backtrace:

error: internal compiler error: src\librustc\ich\impls_ty.rs:213: ty::TyKind::hash_stable() - can't hash a TyVid _#1t.

thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:649:9
stack backtrace:
   0: std::sys_common::alloc::realloc_fallback
   1: std::panicking::take_hook
   2: std::panicking::take_hook
   3: <rustc::ty::layout::LayoutCx<rustc::ty::query::TyCtxtAt> as rustc_target::abi::LayoutOf>::layout_of
   4: std::panicking::rust_panic_with_hook
   5: <rustc_errors::lock::acquire_global_lock::Guard as core::ops::drop::Drop>::drop
   6: rustc_errors::Handler::bug
   7: rustc::util::bug::bug_fmt
   8: rustc::ty::wf::object_region_bounds
   9: rustc::ty::wf::object_region_bounds
  10: rustc::ty::wf::object_region_bounds
  11: rustc::util::bug::bug_fmt
  12: rustc::util::bug::bug_fmt
  13: <rustc::ty::sty::BoundTy as core::convert::From<rustc::ty::sty::BoundVar>>::from
  14: <rustc::ty::sty::TyKind as core::fmt::Debug>::fmt
  15: <rustc::hir::map::hir_id_validator::HirIdValidator as rustc::hir::intravisit::Visitor>::visit_id
  16: <alloc::vec::Vec<(alloc::string::String, u64)> as rustc::session::config::dep_tracking::DepTrackingHash>::hash
  17: <rustc::ty::subst::UnpackedKind as core::fmt::Debug>::fmt
  18: <rustc::util::common::ProfileQueriesMsg as core::fmt::Debug>::fmt
  19: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack
  20: <rustc::traits::query::type_op::ascribe_user_type::AscribeUserType as rustc::traits::query::type_op::QueryTypeOp>::perform_query
  21: <rustc_mir::monomorphize::partitioning::MonoItemPlacement as core::fmt::Debug>::fmt
  22: <rustc_mir::monomorphize::collector::MonoItemCollectionMode as core::fmt::Debug>::fmt
  23: <rustc_mir::borrow_check::nll::type_check::TypeVerifier as rustc::mir::visit::Visitor>::visit_body
  24: <rustc_mir::borrow_check::nll::type_check::relate_tys::NllTypeRelatingDelegate as rustc::infer::nll_relate::TypeRelatingDelegate>::push_domain_goal
  25: <rustc::mir::Location as rustc_mir::borrow_check::nll::type_check::NormalizeLocation>::to_locations
  26: rustc_mir::borrow_check::nll::universal_regions::UniversalRegionIndices::insert_late_bound_region
  27: <rustc_mir::borrow_check::nll::member_constraints::NllMemberConstraintIndex as core::fmt::Debug>::fmt
  28: rustc_mir::borrow_check::nll::universal_regions::UniversalRegionIndices::insert_late_bound_region
  29: rustc_interface::profile::dump
  30: rustc_interface::passes::BoxedGlobalCtxt::complete
  31: rustc_interface::passes::BoxedGlobalCtxt::complete
  32: rustc_interface::passes::BoxedGlobalCtxt::complete
  33: rustc_interface::passes::BoxedGlobalCtxt::complete
  34: rustc_interface::passes::BoxedResolver::to_expansion_result
  35: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  36: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
  37: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  38: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  39: <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt
  40: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  41: <env_logger::filter::inner::Filter as core::fmt::Display>::fmt
  42: <env_logger::filter::inner::Filter as core::fmt::Display>::fmt
  43: <rustc_interface::util::Sink as std::io::Write>::flush
  44: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  45: _rust_maybe_catch_panic
  46: <rustc_mir::dataflow::impls::borrows::Borrows as rustc_mir::dataflow::BitDenotation>::propagate_call_return
  47: ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error..Error$u2b$core..marker..Sync$u2b$core..marker..Send$GT$$GT$..from..StringError$u20$as$u20$core..fmt..Display$GT$3fmt17
  48: std::sys::windows::thread::Thread::new
  49: BaseThreadInitThunk
  50: RtlUserThreadStart
query stack during panic:
#0 [mir_borrowck] processing `vecset::VecSet::<T, ORDER>::search`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

I haven't got it down to a small repro yet, but here's the repo it happens in https://github.com/DutchGhost/vecset/tree/TyVidICE

@DutchGhost DutchGhost changed the title ICE: Can't hash a TyVid ICE: Can't hash a TyVid (const generics???) Jul 15, 2019
@jonas-schievink jonas-schievink 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 Jul 15, 2019
@c410-f3r
Copy link
Contributor

Try to disable incremental compilation.

Related #61338

@Centril Centril added F-const_generics `#![feature(const_generics)]` requires-nightly This issue requires a nightly compiler in some way. labels Oct 25, 2019
@estebank estebank added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Dec 14, 2019
@varkor
Copy link
Member

varkor commented Apr 8, 2020

@DutchGhost: are you able to check if this still ICEs? We fixed some issues with hashing a while ago and hopefully this was addressed along with them.

@DutchGhost
Copy link
Contributor Author

@DutchGhost: are you able to check if this still ICEs? We fixed some issues with hashing a while ago and hopefully this was addressed along with them.

Could not reproduce locally any more, so I guess it's been solved :)

@varkor
Copy link
Member

varkor commented Apr 9, 2020

Since we weren't able to find a MCVE, I'm going to close, as we do have regressions tests for related issues.

@varkor varkor closed this as completed Apr 9, 2020
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. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-const_generics `#![feature(const_generics)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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

6 participants