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 on unused generic in struct #67375

Closed
DutchGhost opened this issue Dec 17, 2019 · 22 comments
Closed

ICE on unused generic in struct #67375

DutchGhost opened this issue Dec 17, 2019 · 22 comments
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` fixed-by-const-generics Enabling feature `const_generics` fixes the issue. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@DutchGhost
Copy link
Contributor

DutchGhost commented Dec 17, 2019

The following ICE's in stable, beta and nightly:

struct Bug<T> {
    inner: [(); { [|_: &T| {}; 0].len() }],
}
Backtrace:
   Compiling playground v0.0.1 (/playground)
error: internal compiler error: src/librustc/ty/subst.rs:557: type parameter `T/#0` (T/0) out of range when substituting (root type=Some([[closure@src/lib.rs:2:20: 2:30]; 0])) substs=[]

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:778:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::span_bug
  14: rustc_errors::Handler::span_bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::span_bug_fmt
  21: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  22: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with
  23: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  24: <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  25: rustc::ty::fold::TypeFoldable::fold_with
  26: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with
  27: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  28: <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  29: rustc::ty::fold::TypeFoldable::fold_with
  30: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with
  31: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  32: <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  33: rustc::ty::fold::TypeFoldable::fold_with
  34: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with
  35: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  36: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with
  37: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  38: rustc::traits::codegen::<impl rustc::ty::context::TyCtxt>::subst_and_normalize_erasing_regions
  39: rustc_mir::interpret::eval_context::InterpCx<M>::layout_of_local
  40: rustc_mir::interpret::place::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_place
  41: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run
  42: rustc_mir::const_eval::const_eval_raw_provider
  43: rustc::ty::query::__query_compute::const_eval_raw
  44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval_raw>::compute
  45: rustc::dep_graph::graph::DepGraph::with_task_impl
  46: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  47: rustc_mir::const_eval::const_eval_provider
  48: rustc::ty::query::__query_compute::const_eval
  49: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute
  50: rustc::dep_graph::graph::DepGraph::with_task_impl
  51: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  52: rustc_mir::const_eval::const_eval_provider
  53: rustc::ty::query::__query_compute::const_eval
  54: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute
  55: rustc::dep_graph::graph::DepGraph::with_task_impl
  56: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  57: rustc::ty::sty::Const::eval
  58: <rustc::traits::project::AssocTypeNormalizer as rustc::ty::fold::TypeFolder>::fold_ty
  59: rustc::traits::project::normalize
  60: rustc_typeck::check::FnCtxt::normalize_associated_types_in
  61: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  62: rustc::ty::context::GlobalCtxt::enter_local
  63: rustc_typeck::check::wfcheck::check_item_well_formed
  64: rustc::ty::query::__query_compute::check_item_well_formed
  65: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::check_item_well_formed>::compute
  66: rustc::dep_graph::graph::DepGraph::with_task_impl
  67: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  68: <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor as rustc::hir::itemlikevisit::ParItemLikeVisitor>::visit_item
  69: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  70: rustc_data_structures::sync::par_for_each_in
  71: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  72: rustc::hir::Crate::par_visit_all_item_likes
  73: rustc::util::common::time
  74: rustc_typeck::check_crate
  75: rustc_interface::passes::analysis
  76: rustc::ty::query::__query_compute::analysis
  77: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  78: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  79: rustc_interface::passes::create_global_ctxt::{{closure}}
  80: rustc_interface::interface::run_compiler_in_existing_thread_pool
  81: std::thread::local::LocalKey<T>::with
  82: scoped_tls::ScopedKey<T>::set
  83: syntax::with_globals
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.39.0 (4560ea788 2019-11-04) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

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

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', src/libcore/result.rs:1165:5
stack backtrace:
   0:     0x7f5d7e137af4 - backtrace::backtrace::libunwind::trace::hda41dbcdfba36aa0
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x7f5d7e137af4 - backtrace::backtrace::trace_unsynchronized::h1a8d6e1f8cb3f5d4
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x7f5d7e137af4 - std::sys_common::backtrace::_print_fmt::h610c4127487e10da
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x7f5d7e137af4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0722dc552e01bd1d
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x7f5d7e17012c - core::fmt::write::h01edf6dd68a42c9c
                               at src/libcore/fmt/mod.rs:1030
   5:     0x7f5d7e12bd17 - std::io::Write::write_fmt::hf15985f193f03c04
                               at src/libstd/io/mod.rs:1412
   6:     0x7f5d7e13c325 - std::sys_common::backtrace::_print::hd8d5d08a1795e743
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x7f5d7e13c325 - std::sys_common::backtrace::print::hf89a79e3921a2366
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f5d7e13c325 - std::panicking::default_hook::{{closure}}::h3a8f42beb3bb8ae3
                               at src/libstd/panicking.rs:196
   9:     0x7f5d7e13c016 - std::panicking::default_hook::h8f803b0bc31a5c37
                               at src/libstd/panicking.rs:210
  10:     0x7f5d7e673483 - rustc_driver::report_ice::he98718c53edc6d3d
  11:     0x7f5d7e13cb0c - std::panicking::rust_panic_with_hook::h825f041245da8739
                               at src/libstd/panicking.rs:477
  12:     0x7f5d7e13c5c2 - std::panicking::continue_panic_fmt::hbe0378e33481e81b
                               at src/libstd/panicking.rs:380
  13:     0x7f5d7e13c4b6 - rust_begin_unwind
                               at src/libstd/panicking.rs:307
  14:     0x7f5d7e169aca - core::panicking::panic_fmt::h527855ce0bc891f6
                               at src/libcore/panicking.rs:85
  15:     0x7f5d7e169d07 - core::result::unwrap_failed::ha8b77e6004f0ba38
                               at src/libcore/result.rs:1165
  16:     0x7f5d8044efe5 - rustc_errors::Handler::force_print_diagnostic::h807dd1aae3e0d79e
  17:     0x7f5d7fd21d91 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h8734d6360e0a8b59
  18:     0x7f5d7e674095 - rustc_driver::report_ice::he98718c53edc6d3d
  19:     0x7f5d7e13cb0c - std::panicking::rust_panic_with_hook::h825f041245da8739
                               at src/libstd/panicking.rs:477
  20:     0x7f5d7ffbe8cd - std::panicking::begin_panic::h97acaf3e9cd227e4
  21:     0x7f5d7f92870c - rustc_errors::HandlerInner::span_bug::h5d7a04d74e00c15b
  22:     0x7f5d7f928a2a - rustc_errors::Handler::span_bug::h8fc1a2348a2faf0a
  23:     0x7f5d7fcde8ce - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hf2652d3cbc7068ac
  24:     0x7f5d7fcd9933 - rustc::ty::context::tls::with_opt::{{closure}}::h0fe4f06c0a285fde
  25:     0x7f5d7fcd98a3 - rustc::ty::context::tls::with_context_opt::h01f88b941c2d3d77
  26:     0x7f5d7fcd98e7 - rustc::ty::context::tls::with_opt::hac6f601ca34cd941
  27:     0x7f5d7fcde7d8 - rustc::util::bug::opt_span_bug_fmt::h234c815c9e7b30ef
  28:     0x7f5d7fcde78a - rustc::util::bug::span_bug_fmt::h20b9ffbed9c0891c
  29:     0x7f5d7faeb0ff - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  30:     0x7f5d7ff46cbc - rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with::h9c270ab536977c7f
  31:     0x7f5d7faeae7e - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  32:     0x7f5d7fb11bb6 - <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter::h8400a40b9c4e6b9a
  33:     0x7f5d7ff3720b - rustc::ty::fold::TypeFoldable::fold_with::hbe621148af1523b0
  34:     0x7f5d7ff46e2b - rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with::h9c270ab536977c7f
  35:     0x7f5d7faeae7e - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  36:     0x7f5d7fb11e86 - <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter::h8454765d432a4096
  37:     0x7f5d7ff373ec - rustc::ty::fold::TypeFoldable::fold_with::hc468099c6af1cfc8
  38:     0x7f5d7ff46d1e - rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with::h9c270ab536977c7f
  39:     0x7f5d7faeae7e - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  40:     0x7f5d7fb11bb6 - <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter::h8400a40b9c4e6b9a
  41:     0x7f5d7ff3720b - rustc::ty::fold::TypeFoldable::fold_with::hbe621148af1523b0
  42:     0x7f5d7ff46d9b - rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with::h9c270ab536977c7f
  43:     0x7f5d7faeae7e - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  44:     0x7f5d7ff46c34 - rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable for &rustc::ty::TyS>::super_fold_with::h9c270ab536977c7f
  45:     0x7f5d7faeae7e - <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty::h9fc1968e8e1b2aa8
  46:     0x7f5d7f07e17b - rustc::traits::codegen::<impl rustc::ty::context::TyCtxt>::subst_and_normalize_erasing_regions::h69ac16e2dde194e5
  47:     0x7f5d7f175794 - rustc_mir::interpret::eval_context::InterpCx<M>::layout_of_local::h7e72eb81e13c3365
  48:     0x7f5d7f17b436 - rustc_mir::interpret::place::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_place::h523e4c7a3524046c
  49:     0x7f5d7f18d64f - rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run::hfddca9f447f81347
  50:     0x7f5d7efe5d95 - rustc_mir::const_eval::const_eval_raw_provider::hca378418cb8b802f
  51:     0x7f5d7f0d4133 - rustc::ty::query::__query_compute::const_eval_raw::h40faa9b9ed7f9ffd
  52:     0x7f5d7eff472a - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval_raw>::compute::h264c546cc8c8f7ff
  53:     0x7f5d7f1356af - rustc::dep_graph::graph::DepGraph::with_task_impl::h2a70cac1884a524e
  54:     0x7f5d7f060d8d - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hdca4664449bd6663
  55:     0x7f5d7efe4791 - rustc_mir::const_eval::const_eval_provider::ha3233606f24ba55a
  56:     0x7f5d7f0d3523 - rustc::ty::query::__query_compute::const_eval::h0c9cbc2ee84a0954
  57:     0x7f5d7eff453a - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute::ha6ad154a6315d6db
  58:     0x7f5d7f1348ba - rustc::dep_graph::graph::DepGraph::with_task_impl::h1e8a994470cda8eb
  59:     0x7f5d7f04472b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h9b8e8aa96625b2a7
  60:     0x7f5d7efe453a - rustc_mir::const_eval::const_eval_provider::ha3233606f24ba55a
  61:     0x7f5d7fafdd2a - rustc::ty::query::__query_compute::const_eval::hdcd5000f53247e70
  62:     0x7f5d7fef26fa - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute::ha6ad154a6315d6db
  63:     0x7f5d7fa55726 - rustc::dep_graph::graph::DepGraph::with_task_impl::h62d1fab1bc159d96
  64:     0x7f5d7fdc45b4 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h981337fab9d39210
  65:     0x7f5d7ff4a5fe - rustc::ty::sty::Const::eval::h0414809ff02bcda4
  66:     0x7f5d7ff2d7a8 - <rustc::traits::project::AssocTypeNormalizer as rustc::ty::fold::TypeFolder>::fold_ty::h2b7457cd882278f8
  67:     0x7f5d7edd0702 - rustc::traits::project::normalize::h60f46f5d1c5639d2
  68:     0x7f5d7ebfd037 - rustc_typeck::check::FnCtxt::normalize_associated_types_in::he38c3b31e77883a8
  69:     0x7f5d7eccd83c - <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::he6498e22241dcdc8
  70:     0x7f5d7ed5e36b - rustc::ty::context::GlobalCtxt::enter_local::hceda0adbe885e557
  71:     0x7f5d7ec26ce6 - rustc_typeck::check::wfcheck::check_item_well_formed::h424e7a4b21128c9a
  72:     0x7f5d7ec4336a - rustc::ty::query::__query_compute::check_item_well_formed::h6740554c6e776f0a
  73:     0x7f5d7ecdc32b - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::check_item_well_formed>::compute::ha97091e8ad0a4a28
  74:     0x7f5d7ec6cb3d - rustc::dep_graph::graph::DepGraph::with_task_impl::h02274190e9e1d45f
  75:     0x7f5d7ece9b7a - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h05b66a8952f105e6
  76:     0x7f5d7ec2a146 - <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor as rustc::hir::itemlikevisit::ParItemLikeVisitor>::visit_item::ha7ed3e8b1755f566
  77:     0x7f5d7e14d25a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  78:     0x7f5d7eca47bc - rustc_data_structures::sync::par_for_each_in::h383c73eb700cb8af
  79:     0x7f5d7e14d25a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  80:     0x7f5d7ec1e1e3 - rustc::hir::Crate::par_visit_all_item_likes::h76ea15e5dfdd9ae2
  81:     0x7f5d7ec47adb - rustc::util::common::time::hc8688ef5cd19c790
  82:     0x7f5d7ee17553 - rustc_typeck::check_crate::h2e77f97476aecad8
  83:     0x7f5d7e72200a - rustc_interface::passes::analysis::h7d37d49a7360493d
  84:     0x7f5d7e635c01 - rustc::ty::query::__query_compute::analysis::h1c5cc76ea5bb496b
  85:     0x7f5d7e61ed8e - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hcf7bc9d073dcb36b
  86:     0x7f5d7e63d42a - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::h7fc0f9f179325408
  87:     0x7f5d7e79e1da - rustc_interface::passes::create_global_ctxt::{{closure}}::h10595b15ffb5db35
  88:     0x7f5d7e63f64e - rustc_interface::interface::run_compiler_in_existing_thread_pool::ha009ae4607895a11
  89:     0x7f5d7e675362 - std::thread::local::LocalKey<T>::with::h30eaff0b6e71bc49
  90:     0x7f5d7e67a3ce - scoped_tls::ScopedKey<T>::set::h6ab0051cc42102a7
  91:     0x7f5d7e69b1a2 - syntax::with_globals::h9994c1c3242d3263
  92:     0x7f5d7e607e10 - std::sys_common::backtrace::__rust_begin_short_backtrace::h229c554686840b66
  93:     0x7f5d7e14d25a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  94:     0x7f5d7e631879 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf2e117c529f2753f
  95:     0x7f5d7e11e1ff - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h483711add4ba2330
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/boxed.rs:922
  96:     0x7f5d7e14bf00 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h7605b45eb29ed0be
                               at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/liballoc/boxed.rs:922
  97:     0x7f5d7e14bf00 - std::sys_common::thread::start_thread::h557b0c2dc4449562
                               at src/libstd/sys_common/thread.rs:13
  98:     0x7f5d7e14bf00 - std::sys::unix::thread::Thread::new::thread_start::h7c2a7f9b68fe4bba
                               at src/libstd/sys/unix/thread.rs:79
  99:     0x7f5d7deb86db - start_thread
 100:     0x7f5d7d7d588f - __clone
 101:                0x0 - <unknown>

error: internal compiler error: unexpected panic

Also I noted an illigal instruction in the output of how it was compiled. It says so at the verry verry end of this output:
https://pastebin.com/Wd299cWN
or easier to see in this screenshot: http://prntscr.com/qc8252

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 17, 2019
@DutchGhost
Copy link
Contributor Author

DutchGhost commented Dec 17, 2019

A quick look on godbold gives that this ICE's in 1.17, 1.18, and from 1.22 including onwards

@DutchGhost
Copy link
Contributor Author

The illigal instruction happens when export RUST_BACKTRACE=1 is set, and cargo is runned with cargo build -v

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 18, 2019
@pnkfelix
Copy link
Member

triage: P-high, removing nomination.

@camelid
Copy link
Member

camelid commented Sep 19, 2020

@rustbot modify labels: E-needs-bisection

@rustbot rustbot added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Sep 19, 2020
@camelid
Copy link
Member

camelid commented Sep 19, 2020

I did a rough bisection with Godbolt and found this ICE was introduced in the Rust 1.17 release. Though this never worked (at least on stable); in previous versions there were various const-eval non-ICE errors.

@camelid
Copy link
Member

camelid commented Sep 19, 2020

Okay, I ran cargo bisect-rustc:

searched toolchains nightly-2017-02-28 through nightly-2017-05-01


********************************************************************************
Regression in nightly-2017-03-04
********************************************************************************

@camelid
Copy link
Member

camelid commented Sep 20, 2020

Requesting reprioritization.

@rustbot modify labels: +I-prioritized

@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2020

Error: Label P-high can only be set by Rust team members

Please let @rust-lang/release know if you're having trouble with this bot.

@camelid
Copy link
Member

camelid commented Sep 20, 2020

Hmm, rustbot isn't setting the label... I think I'm allowed to do that:

"I-*", "!I-nominated",

@Dylan-DPC-zz
Copy link

well you need to re-"request to prioritise" it not re-prioritise it , so you should mark it as I-priortize so we can discuss it.

@camelid
Copy link
Member

camelid commented Sep 20, 2020

Oops, it's because I made a typo :)

@rustbot modify labels: I-prioritize

@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 20, 2020
@lcnr
Copy link
Contributor

lcnr commented Sep 21, 2020

related to const generics, fixed by both min_const_generics and const_generics.

This bug is expected, marking as E-needs-test for now.

@lcnr lcnr added const-generics-needs-test-for-min_const_generics E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Sep 21, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 21, 2020

Re-prioritizing as P-medium as discussed by the prioritization WG.

@jyn514 jyn514 added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. and removed P-high High priority labels Sep 21, 2020
@jyn514 jyn514 added P-medium Medium priority and removed E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 21, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Oct 5, 2020
…lcnr,estebank

Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics`

Closes rust-lang#61410.

Adds `min_const_generics` tests for:
- rust-lang#73727
- rust-lang#72293
- rust-lang#67375
- rust-lang#75153
- rust-lang#71922
- rust-lang#69913
- rust-lang#67945
- rust-lang#69239

Adds `const_generics` tests for:
- rust-lang#67375
- rust-lang#75153
- rust-lang#71922
- rust-lang#69913
- rust-lang#67945
- rust-lang#69239

(I only added separate `min_const_generics` and `const_generics` tests if they were handled differently by the two features.)

We need to figure out how to deduplicate when `const_generics` is stabilised, but we can discuss that later. For now, we should be checking neither feature breaks, so require regression tests for both. I've given them identical names when I've added both, which should make it easier to spot them later.

r? @lcnr
@workingjubilee
Copy link
Member

Test was added in #77439.
@rustbot modify labels: -E-needs-test

@rustbot rustbot removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 9, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 9, 2020

If this is fixed with a test, it can be closed, right?

@Dylan-DPC-zz
Copy link

yup

@jyn514
Copy link
Member

jyn514 commented Oct 9, 2020

However it looks like this hasn't actually been fixed: it still ICEs unless you add #![feature(min_const_generics)] to the top of the code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0dba614666d8bbb508b1cf3310d5c70d

@jyn514
Copy link
Member

jyn514 commented Oct 9, 2020

@lcnr is that expected behavior? ^

@lcnr
Copy link
Contributor

lcnr commented Oct 9, 2020

It is expected to ICE without const generics, so we may want to keep this issue open until min_const_generics gets stabilized.

I do however feel like that won't be that useful as we won't work on fixing this until then.

@workingjubilee
Copy link
Member

I've added several labels, and come up with a system to help us track what remains. It's slightly complicated, because we need to track three versions of Rust essentially: nightly, #![feature(min_const_generics)], and #![feature(const_generics)], which can all behave differently.

[..]

In summary, after addressing E-needs-test, if the issue still occurs on nightly or under #![feature(const_generics)], don't close the issue.

Originally posted by @varkor in #74878 (comment)

@varkor
Copy link
Member

varkor commented Oct 10, 2020

Let's leave as open for now, though hopefully we're not far from stabilisation anyway, so we should be able to close this issue again soon.

@JohnTitor
Copy link
Member

Triage:
This is no longer ICE with the min_const_generics stabilization: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9f1a1834d0d8a9624f4c629a0798ad90

@varkor varkor closed this as completed Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` fixed-by-const-generics Enabling feature `const_generics` fixes the issue. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority 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