Skip to content

nightly rustc crash with generic_const_exprs #108329

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

Closed
kyoobey opened this issue Feb 22, 2023 · 1 comment
Closed

nightly rustc crash with generic_const_exprs #108329

kyoobey opened this issue Feb 22, 2023 · 1 comment
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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

@kyoobey
Copy link

kyoobey commented Feb 22, 2023

Code

minimal example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=f0e553103ea57b8dc9452b29ea1483f7

pub fn take (&mut self) -> Vec<T> {
	let mut buf = Vec::with_capacity(self.buffer.len());
	buf.copy_from_slice(self.buffer[..]);
	self.index = S - 1;
	buf
}

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (5243ea5c2 2023-02-20)
binary: rustc
commit-hash: 5243ea5c29b136137c36bd773e5baa663790e097
commit-date: 2023-02-20
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

cargo b

   Compiling rust_crash v0.1.0 (/home/user/projects/rust_crash)
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> src/lib.rs:8:12
  |
8 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

thread 'rustc' panicked at 'index out of bounds: the len is 30 but the index is 31', /cargo/registry/src/index.crates.io-6f17d22bba15001f/ena-0.14.0/src/snapshot_vec.rs:199:10
stack backtrace:
   0:     0x7f326ef6ab3a - std::backtrace_rs::backtrace::libunwind::trace::h12b28b68eb26bd66
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f326ef6ab3a - std::backtrace_rs::backtrace::trace_unsynchronized::h200511c4f08d08ef
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f326ef6ab3a - std::sys_common::backtrace::_print_fmt::h73434ecb073097d4
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f326ef6ab3a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7808d0be79b5d1ec
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f326efcab0e - core::fmt::write::hafefc351fbfaa415
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f326ef5afe5 - std::io::Write::write_fmt::hc1d6b1569406505e
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/io/mod.rs:1684:15
   6:     0x7f326ef6a905 - std::sys_common::backtrace::_print::hd45cfc7e9c4b34ea
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f326ef6a905 - std::sys_common::backtrace::print::h5e03fe95d9240812
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f326ef6d67f - std::panicking::default_hook::{{closure}}::hf95a102fbb1a711a
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:267:22
   9:     0x7f326ef6d3bb - std::panicking::default_hook::h0e224ad71e4cf3c6
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:286:9
  10:     0x7f327221fcb5 - <rustc_driver_impl[6598fd657388da4]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[e6e25e2e3d2ed08b]::ops::function::FnOnce<(&core[e6e25e2e3d2ed08b]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f326ef6debd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha8273e13c0202daf
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:2002:9
  12:     0x7f326ef6debd - std::panicking::rust_panic_with_hook::hfa97f871b11d16ea
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:692:13
  13:     0x7f326ef6dc39 - std::panicking::begin_panic_handler::{{closure}}::hd45660eb8177c8ba
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:579:13
  14:     0x7f326ef6afa6 - std::sys_common::backtrace::__rust_end_short_backtrace::h24cc9aac7fd6776a
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f326ef6d942 - rust_begin_unwind
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:575:5
  16:     0x7f326efc74b3 - core::panicking::panic_fmt::he7b2d47a249dbf70
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/core/src/panicking.rs:64:14
  17:     0x7f326efc76a2 - core::panicking::panic_bounds_check::hb3bb534e3eb7e7e0
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/core/src/panicking.rs:159:5
  18:     0x7f327024a72e - <ena[15ff791d80d10dd6]::unify::UnificationTable<ena[15ff791d80d10dd6]::unify::backing_vec::InPlace<rustc_infer[363360bf8ff4ba6e]::infer::type_variable::TyVidEqKey, &mut alloc[3f8e9f68cf11003c]::vec::Vec<ena[15ff791d80d10dd6]::unify::VarValue<rustc_infer[363360bf8ff4ba6e]::infer::type_variable::TyVidEqKey>>, &mut rustc_infer[363360bf8ff4ba6e]::infer::undo_log::InferCtxtUndoLogs>>>::uninlined_get_root_key
  19:     0x7f32703224db - <rustc_infer[363360bf8ff4ba6e]::infer::combine::Generalizer as rustc_middle[6454e605f0b552d3]::ty::relate::TypeRelation>::tys
  20:     0x7f327031ab64 - rustc_middle[6454e605f0b552d3]::ty::relate::super_relate_tys::<rustc_infer[363360bf8ff4ba6e]::infer::combine::Generalizer>
  21:     0x7f327032231d - <rustc_infer[363360bf8ff4ba6e]::infer::combine::Generalizer as rustc_middle[6454e605f0b552d3]::ty::relate::TypeRelation>::tys
  22:     0x7f327028dbf7 - <rustc_infer[363360bf8ff4ba6e]::infer::equate::Equate as rustc_middle[6454e605f0b552d3]::ty::relate::TypeRelation>::tys
  23:     0x7f327117d7e4 - <rustc_infer[363360bf8ff4ba6e]::infer::at::At>::eq::<rustc_middle[6454e605f0b552d3]::ty::Ty>
  24:     0x7f327242ea8c - <rustc_infer[363360bf8ff4ba6e]::infer::InferCtxt>::can_eq::<rustc_middle[6454e605f0b552d3]::ty::Ty>
  25:     0x7f32723d5b29 - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::point_at_expr_source_of_inferred_type
  26:     0x7f32723e8857 - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::report_arg_errors
  27:     0x7f32708525d9 - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::check_argument_types
  28:     0x7f32705441d0 - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7f327056f245 - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::check_block_with_expected
  30:     0x7f3270542a5d - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7f32711773ab - <rustc_hir_typeck[87bb278bea18fe2d]::fn_ctxt::FnCtxt>::check_return_expr
  32:     0x7f327116f754 - rustc_hir_typeck[87bb278bea18fe2d]::check::check_fn
  33:     0x7f3271158a5a - rustc_hir_typeck[87bb278bea18fe2d]::typeck
  34:     0x7f3270fe36c3 - <rustc_query_system[e1d6d01a6f4eeda5]::dep_graph::graph::DepGraph<rustc_middle[6454e605f0b552d3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt, rustc_span[5f03c33a4a98a2db]::def_id::LocalDefId, &rustc_middle[6454e605f0b552d3]::ty::typeck_results::TypeckResults>
  35:     0x7f3270fda277 - rustc_query_system[e1d6d01a6f4eeda5]::query::plumbing::try_execute_query::<rustc_query_impl[2383e868c5804bd1]::queries::typeck, rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt>
  36:     0x7f32719dedcb - rustc_data_structures[b1fe04a92ebabb45]::sync::par_for_each_in::<&[rustc_span[5f03c33a4a98a2db]::def_id::LocalDefId], <rustc_middle[6454e605f0b552d3]::hir::map::Map>::par_body_owners<rustc_hir_typeck[87bb278bea18fe2d]::typeck_item_bodies::{closure#0}>::{closure#0}>
  37:     0x7f32719dec0f - rustc_hir_typeck[87bb278bea18fe2d]::typeck_item_bodies
  38:     0x7f3271a20888 - <rustc_query_system[e1d6d01a6f4eeda5]::dep_graph::graph::DepGraph<rustc_middle[6454e605f0b552d3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt, (), ()>
  39:     0x7f327185aced - rustc_query_system[e1d6d01a6f4eeda5]::query::plumbing::try_execute_query::<rustc_query_impl[2383e868c5804bd1]::queries::typeck_item_bodies, rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt>
  40:     0x7f3271c1e49b - <rustc_query_impl[2383e868c5804bd1]::Queries as rustc_middle[6454e605f0b552d3]::ty::query::QueryEngine>::typeck_item_bodies
  41:     0x7f3270631d23 - <rustc_session[2f74c47efaaecf50]::session::Session>::time::<(), rustc_hir_analysis[63c8f16ce92b0e6a]::check_crate::{closure#7}>
  42:     0x7f327062ec1d - rustc_hir_analysis[63c8f16ce92b0e6a]::check_crate
  43:     0x7f3270626222 - rustc_interface[a4c456754224e9c7]::passes::analysis
  44:     0x7f3271a4da61 - <rustc_query_system[e1d6d01a6f4eeda5]::dep_graph::graph::DepGraph<rustc_middle[6454e605f0b552d3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt, (), core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>
  45:     0x7f3271a4d0d2 - rustc_query_system[e1d6d01a6f4eeda5]::query::plumbing::try_execute_query::<rustc_query_impl[2383e868c5804bd1]::queries::analysis, rustc_query_impl[2383e868c5804bd1]::plumbing::QueryCtxt>
  46:     0x7f3271c17d4a - <rustc_query_impl[2383e868c5804bd1]::Queries as rustc_middle[6454e605f0b552d3]::ty::query::QueryEngine>::analysis
  47:     0x7f32714cbbf6 - <rustc_middle[6454e605f0b552d3]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[6598fd657388da4]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>
  48:     0x7f32714caf07 - <rustc_interface[a4c456754224e9c7]::interface::Compiler>::enter::<rustc_driver_impl[6598fd657388da4]::run_compiler::{closure#1}::{closure#2}, core[e6e25e2e3d2ed08b]::result::Result<core[e6e25e2e3d2ed08b]::option::Option<rustc_interface[a4c456754224e9c7]::queries::Linker>, rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>
  49:     0x7f32714c8fe4 - rustc_span[5f03c33a4a98a2db]::with_source_map::<core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>, rustc_interface[a4c456754224e9c7]::interface::run_compiler<core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>, rustc_driver_impl[6598fd657388da4]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  50:     0x7f32714c854d - std[33065b4dbfe75df]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a4c456754224e9c7]::util::run_in_thread_pool_with_globals<rustc_interface[a4c456754224e9c7]::interface::run_compiler<core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>, rustc_driver_impl[6598fd657388da4]::run_compiler::{closure#1}>::{closure#0}, core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>
  51:     0x7f32714c7f9c - <<std[33065b4dbfe75df]::thread::Builder>::spawn_unchecked_<rustc_interface[a4c456754224e9c7]::util::run_in_thread_pool_with_globals<rustc_interface[a4c456754224e9c7]::interface::run_compiler<core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>, rustc_driver_impl[6598fd657388da4]::run_compiler::{closure#1}>::{closure#0}, core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6e25e2e3d2ed08b]::result::Result<(), rustc_errors[e1f9be18bff28896]::ErrorGuaranteed>>::{closure#1} as core[e6e25e2e3d2ed08b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  52:     0x7f326ef77d93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfdd75e8d431ebcab
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
  53:     0x7f326ef77d93 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hac9c6d75eef1e452
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
  54:     0x7f326ef77d93 - std::sys::unix::thread::Thread::new::thread_start::h1e79a6f313450114
                               at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys/unix/thread.rs:108:17
  55:     0x7f326ed07bb5 - <unknown>
  56:     0x7f326ed89d90 - <unknown>
  57:                0x0 - <unknown>

error: 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.69.0-nightly (5243ea5c2 2023-02-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=/usr/bin/mold

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

query stack during panic:
#0 [typeck] type-checking `<impl at src/lib.rs:87:1: 87:49>::take`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: no errors reported for args
  --> src/lib.rs:97:7
   |
97 |         buf.copy_from_slice(self.buffer[..]);
   |             ^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_arg_errors
              3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
              8: rustc_hir_typeck::check::check_fn
              9: rustc_hir_typeck::typeck
             10: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::typeck_results::TypeckResults>
             11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             12: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
             13: rustc_hir_typeck::typeck_item_bodies
             14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), ()>
             15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             17: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             18: rustc_hir_analysis::check_crate
             19: rustc_interface::passes::analysis
             20: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             23: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             24: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
             25: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             26: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             27: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             28: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
             29: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
             30: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys/unix/thread.rs:108:17
             31: <unknown>
             32: <unknown>


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.69.0-nightly (5243ea5c2 2023-02-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=/usr/bin/mold

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
warning: `rust_crash` (lib) generated 1 warning
error: could not compile `rust_crash`; 1 warning emitted

Caused by:
  process didn't exit successfully: `rustc --crate-name rust_crash --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=150 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=f658f221ff8fc457 -C extra-filename=-f658f221ff8fc457 --out-dir /home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -C linker=clang -C incremental=/home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/incremental -L dependency=/home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/home/user/projects/rust_crash/target/debug/deps -C link-arg=-fuse-ld=/usr/bin/mold` (signal: 6, SIGABRT: process abort signal)

Backtrace

   Compiling rust_crash v0.1.0 (/home/user/projects/rust_crash)
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> src/lib.rs:8:12
  |
8 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

thread 'rustc' panicked at 'index out of bounds: the len is 30 but the index is 31', /cargo/registry/src/index.crates.io-6f17d22bba15001f/ena-0.14.0/src/snapshot_vec.rs:199:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/core/src/panicking.rs:64:14
   2: core::panicking::panic_bounds_check
             at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/core/src/panicking.rs:159:5
   3: <ena::unify::UnificationTable<ena::unify::backing_vec::InPlace<rustc_infer::infer::type_variable::TyVidEqKey, &mut alloc::vec::Vec<ena::unify::VarValue<rustc_infer::infer::type_variable::TyVidEqKey>>, &mut rustc_infer::infer::undo_log::InferCtxtUndoLogs>>>::uninlined_get_root_key
   4: <rustc_infer::infer::combine::Generalizer as rustc_middle::ty::relate::TypeRelation>::tys
   5: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::combine::Generalizer>
   6: <rustc_infer::infer::combine::Generalizer as rustc_middle::ty::relate::TypeRelation>::tys
   7: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
   8: <rustc_infer::infer::at::At>::eq::<rustc_middle::ty::Ty>
   9: <rustc_infer::infer::InferCtxt>::can_eq::<rustc_middle::ty::Ty>
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::point_at_expr_source_of_inferred_type
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_arg_errors
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  17: rustc_hir_typeck::check::check_fn
  18: rustc_hir_typeck::typeck
  19: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::typeck_results::TypeckResults>
  20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  21: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
  22: rustc_hir_typeck::typeck_item_bodies
  23: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), ()>
  24: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  25: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  26: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
  27: rustc_hir_analysis::check_crate
  28: rustc_interface::passes::analysis
  29: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  31: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  32: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  33: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  34: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.69.0-nightly (5243ea5c2 2023-02-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=/usr/bin/mold

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

query stack during panic:
#0 [typeck] type-checking `<impl at src/lib.rs:87:1: 87:49>::take`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: no errors reported for args
  --> src/lib.rs:97:7
   |
97 |         buf.copy_from_slice(self.buffer[..]);
   |             ^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_arg_errors
              3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
              8: rustc_hir_typeck::check::check_fn
              9: rustc_hir_typeck::typeck
             10: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::typeck_results::TypeckResults>
             11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             12: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
             13: rustc_hir_typeck::typeck_item_bodies
             14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), ()>
             15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             17: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             18: rustc_hir_analysis::check_crate
             19: rustc_interface::passes::analysis
             20: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             23: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             24: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
             25: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             26: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
             27: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             28: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
             29: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/alloc/src/boxed.rs:1988:9
             30: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/5243ea5c29b136137c36bd773e5baa663790e097/library/std/src/sys/unix/thread.rs:108:17
             31: <unknown>
             32: <unknown>


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.69.0-nightly (5243ea5c2 2023-02-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=/usr/bin/mold

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
warning: `rust_crash` (lib) generated 1 warning
error: could not compile `rust_crash`; 1 warning emitted

Caused by:
  process didn't exit successfully: `rustc --crate-name rust_crash --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=150 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=f658f221ff8fc457 -C extra-filename=-f658f221ff8fc457 --out-dir /home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -C linker=clang -C incremental=/home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/incremental -L dependency=/home/user/projects/rust_crash/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/home/user/projects/rust_crash/target/debug/deps -C link-arg=-fuse-ld=/usr/bin/mold` (signal: 6, SIGABRT: process abort signal)

@kyoobey kyoobey 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 Feb 22, 2023
@BoxyUwU BoxyUwU added A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Feb 24, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 3, 2023
@Alexendoo
Copy link
Member

Fixed by #108667

@compiler-errors compiler-errors self-assigned this Mar 16, 2023
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-generic_const_exprs `#![feature(generic_const_exprs)]` glacier ICE tracked in rust-lang/glacier. 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

5 participants