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 after using const for const generic param #111055

Closed
Tracked by #106994
ericlagergren opened this issue May 1, 2023 · 3 comments
Closed
Tracked by #106994

ICE after using const for const generic param #111055

ericlagergren opened this issue May 1, 2023 · 3 comments
Labels
C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` F-inherent_associated_types `#![feature(inherent_associated_types)]` 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

@ericlagergren
Copy link

Code

The ICE occurred after I used DEFAULT_CHUNK_SIZE as the generic const parameter for Reader and Writer instead of using a literal.

Here is the exact code: ericlagergren/stream-rs@4608177

I don't have a minimal repro, sorry.

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (b628260df 2023-04-22)
binary: rustc
commit-hash: b628260df0587ae559253d8640ecb8738d3de613
commit-date: 2023-04-22
host: aarch64-apple-darwin
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

$ cargo test --features std -- --nocapture
   Compiling stream v0.1.0 (/Users/eric/git/stream-rs)
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:915:9: const parameter `C/#3` (Const { ty: usize, kind: Param(C/#3) }/3) out of range when substituting substs=['_#38r, _, chacha20poly1305::ChaChaPoly1305<aes::cipher::StreamCipherCoreWrapper<chacha20::xchacha::XChaChaCore<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UTerm, aead::consts::B1>, aead::consts::B0>, aead::consts::B1>, aead::consts::B0>>>, aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UTerm, aead::consts::B1>, aead::consts::B1>, aead::consts::B0>, aead::consts::B0>, aead::consts::B0>>]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/b628260df0587ae559253d8640ecb8738d3de613/compiler/rustc_errors/src/lib.rs:1643:9
stack backtrace:
   0:        0x10313c78c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h378faa8cd2682042
   1:        0x10318c7cc - core::fmt::write::h45332108b05b8919
   2:        0x1031326ac - std::io::Write::write_fmt::hde34ad6d308b1301
   3:        0x10313c5ec - std::sys_common::backtrace::print::h55a4c014a10aac9b
   4:        0x10313eecc - std::panicking::default_hook::{{closure}}::h293442e8007a84b1
   5:        0x10313ebc4 - std::panicking::default_hook::hcf46e03ff7863c39
   6:        0x10b678510 - rustc_driver_impl[682bce9d94f8fc57]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10313f530 - std::panicking::rust_panic_with_hook::h32c159227be0227d
   8:        0x10f43bd28 - std[11e8f5d0c59412da]::panicking::begin_panic::<rustc_errors[69a9607651256b12]::ExplicitBug>::{closure#0}
   9:        0x10f4397b8 - std[11e8f5d0c59412da]::sys_common::backtrace::__rust_end_short_backtrace::<std[11e8f5d0c59412da]::panicking::begin_panic<rustc_errors[69a9607651256b12]::ExplicitBug>::{closure#0}, !>
  10:        0x10fa745d8 - std[11e8f5d0c59412da]::panicking::begin_panic::<rustc_errors[69a9607651256b12]::ExplicitBug>
  11:        0x10f4fdae4 - <rustc_errors[69a9607651256b12]::HandlerInner>::bug::<&alloc[2d8f6ce60904bd49]::string::String>
  12:        0x10f4fd7a8 - <rustc_errors[69a9607651256b12]::Handler>::bug::<&alloc[2d8f6ce60904bd49]::string::String>
  13:        0x10f4a01c4 - rustc_middle[741ab025093759e2]::util::bug::opt_span_bug_fmt::<rustc_span[6c3f9550a9acf6ff]::span_encoding::Span>::{closure#0}
  14:        0x10f49fbb0 - rustc_middle[741ab025093759e2]::ty::context::tls::with_opt::<rustc_middle[741ab025093759e2]::util::bug::opt_span_bug_fmt<rustc_span[6c3f9550a9acf6ff]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:        0x10f49fb7c - rustc_middle[741ab025093759e2]::ty::context::tls::with_context_opt::<rustc_middle[741ab025093759e2]::ty::context::tls::with_opt<rustc_middle[741ab025093759e2]::util::bug::opt_span_bug_fmt<rustc_span[6c3f9550a9acf6ff]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:        0x10fa74598 - rustc_middle[741ab025093759e2]::util::bug::bug_fmt
  17:        0x10fa7456c - <rustc_middle[741ab025093759e2]::ty::subst::SubstFolder>::const_param_out_of_range
  18:        0x10f49eb5c - <rustc_middle[741ab025093759e2]::ty::subst::SubstFolder as rustc_type_ir[eba729774b85a827]::fold::TypeFolder<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::fold_const
  19:        0x10f4c183c - rustc_middle[741ab025093759e2]::ty::util::fold_list::<rustc_middle[741ab025093759e2]::ty::subst::SubstFolder, rustc_middle[741ab025093759e2]::ty::subst::GenericArg, <&rustc_middle[741ab025093759e2]::ty::list::List<rustc_middle[741ab025093759e2]::ty::subst::GenericArg> as rustc_type_ir[eba729774b85a827]::fold::TypeFoldable<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::try_fold_with<rustc_middle[741ab025093759e2]::ty::subst::SubstFolder>::{closure#0}>
  20:        0x10f51437c - <rustc_middle[741ab025093759e2]::ty::consts::kind::ConstKind as rustc_type_ir[eba729774b85a827]::fold::TypeFoldable<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[741ab025093759e2]::ty::subst::SubstFolder>
  21:        0x10f49ea64 - <rustc_middle[741ab025093759e2]::ty::subst::SubstFolder as rustc_type_ir[eba729774b85a827]::fold::TypeFolder<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::fold_const
  22:        0x10f41a814 - <rustc_middle[741ab025093759e2]::ty::Ty as rustc_type_ir[eba729774b85a827]::fold::TypeSuperFoldable<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::super_fold_with::<rustc_middle[741ab025093759e2]::ty::subst::SubstFolder>
  23:        0x10f42a37c - <rustc_middle[741ab025093759e2]::ty::PredicateKind as rustc_type_ir[eba729774b85a827]::fold::TypeFoldable<rustc_middle[741ab025093759e2]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[741ab025093759e2]::ty::subst::SubstFolder>
  24:        0x10f497980 - <alloc[2d8f6ce60904bd49]::vec::Vec<rustc_middle[741ab025093759e2]::ty::Predicate> as alloc[2d8f6ce60904bd49]::vec::spec_extend::SpecExtend<rustc_middle[741ab025093759e2]::ty::Predicate, core[48081c40cc16d56a]::iter::adapters::map::Map<core[48081c40cc16d56a]::slice::iter::Iter<(rustc_middle[741ab025093759e2]::ty::Predicate, rustc_span[6c3f9550a9acf6ff]::span_encoding::Span)>, <rustc_middle[741ab025093759e2]::ty::generics::GenericPredicates>::instantiate_into::{closure#0}>>>::spec_extend
  25:        0x10f467a30 - <rustc_middle[741ab025093759e2]::ty::generics::GenericPredicates>::instantiate_into
  26:        0x10f46284c - <rustc_middle[741ab025093759e2]::ty::generics::GenericPredicates>::instantiate
  27:        0x10f293fb0 - <rustc_trait_selection[b36b2923aaa59c51]::traits::wf::WfPredicates>::nominal_obligations_inner
  28:        0x10f293168 - <rustc_trait_selection[b36b2923aaa59c51]::traits::wf::WfPredicates>::compute
  29:        0x10f291230 - rustc_trait_selection[b36b2923aaa59c51]::traits::wf::obligations
  30:        0x10f1dfa9c - <rustc_trait_selection[b36b2923aaa59c51]::traits::fulfill::FulfillProcessor as rustc_data_structures[c8f33e9f1943a882]::obligation_forest::ObligationProcessor>::process_obligation
  31:        0x10f23277c - <rustc_data_structures[c8f33e9f1943a882]::obligation_forest::ObligationForest<rustc_trait_selection[b36b2923aaa59c51]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[b36b2923aaa59c51]::traits::fulfill::FulfillProcessor>
  32:        0x10f1dd590 - <rustc_trait_selection[b36b2923aaa59c51]::traits::fulfill::FulfillmentContext as rustc_infer[38e46633d49da186]::traits::engine::TraitEngine>::select_where_possible
  33:        0x10da6bf6c - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::resolve_vars_with_obligations
  34:        0x10da70b0c - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::structurally_resolved_type
  35:        0x10da54184 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_call
  36:        0x10daaa0c8 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_kind
  37:        0x10da644fc - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  38:        0x10daaa120 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_kind
  39:        0x10da644fc - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  40:        0x10da79a44 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_decl
  41:        0x10da79e64 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_stmt
  42:        0x10da7a5b4 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_block_with_expected
  43:        0x10daa9d10 - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_kind
  44:        0x10da644fc - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  45:        0x10da656dc - <rustc_hir_typeck[bb7242f866fd7396]::fn_ctxt::FnCtxt>::check_return_expr
  46:        0x10db42a50 - rustc_hir_typeck[bb7242f866fd7396]::check::check_fn
  47:        0x10daec604 - rustc_hir_typeck[bb7242f866fd7396]::typeck
  48:        0x10e924274 - <std[11e8f5d0c59412da]::thread::local::LocalKey<core[48081c40cc16d56a]::cell::Cell<*const ()>>>::with::<rustc_middle[741ab025093759e2]::ty::context::tls::enter_context<rustc_query_system[7201fc8115d54486]::query::plumbing::execute_job_incr<rustc_query_impl[4a148186806e296e]::queries::typeck, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>
  49:        0x10e80a250 - rustc_query_system[7201fc8115d54486]::query::plumbing::try_execute_query::<rustc_query_impl[4a148186806e296e]::queries::typeck, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  50:        0x10e7828d4 - rustc_query_system[7201fc8115d54486]::query::plumbing::force_query::<rustc_query_impl[4a148186806e296e]::queries::typeck, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  51:        0x10e99de7c - <rustc_query_impl[4a148186806e296e]::plumbing::query_callback<rustc_query_impl[4a148186806e296e]::queries::typeck>::{closure#0} as core[48081c40cc16d56a]::ops::function::FnOnce<(rustc_middle[741ab025093759e2]::ty::context::TyCtxt, rustc_query_system[7201fc8115d54486]::dep_graph::dep_node::DepNode<rustc_middle[741ab025093759e2]::dep_graph::dep_node::DepKind>)>>::call_once
  52:        0x10e97bbe4 - <rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepGraphData<rustc_middle[741ab025093759e2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  53:        0x10e97b89c - <rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepGraphData<rustc_middle[741ab025093759e2]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  54:        0x10e8db668 - <std[11e8f5d0c59412da]::thread::local::LocalKey<core[48081c40cc16d56a]::cell::Cell<*const ()>>>::with::<rustc_middle[741ab025093759e2]::ty::context::tls::enter_context<rustc_query_system[7201fc8115d54486]::query::plumbing::execute_job_incr<rustc_query_impl[4a148186806e296e]::queries::typeck_item_bodies, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>::{closure#1}, core[48081c40cc16d56a]::option::Option<(rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[48081c40cc16d56a]::option::Option<(rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>>
  55:        0x10e7caea4 - rustc_query_system[7201fc8115d54486]::query::plumbing::try_execute_query::<rustc_query_impl[4a148186806e296e]::queries::typeck_item_bodies, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  56:        0x10ea08648 - <rustc_query_impl[4a148186806e296e]::Queries as rustc_middle[741ab025093759e2]::ty::query::QueryEngine>::typeck_item_bodies
  57:        0x10dc2c274 - rustc_hir_analysis[d62de3e2f4dddc31]::check_crate
  58:        0x10b729808 - rustc_interface[8543ccb9fbf59e1b]::passes::analysis
  59:        0x10e9265a4 - <std[11e8f5d0c59412da]::thread::local::LocalKey<core[48081c40cc16d56a]::cell::Cell<*const ()>>>::with::<rustc_middle[741ab025093759e2]::ty::context::tls::enter_context<rustc_query_system[7201fc8115d54486]::query::plumbing::execute_job_incr<rustc_query_impl[4a148186806e296e]::queries::analysis, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[741ab025093759e2]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[7201fc8115d54486]::dep_graph::graph::DepNodeIndex)>
  60:        0x10e80b660 - rustc_query_system[7201fc8115d54486]::query::plumbing::try_execute_query::<rustc_query_impl[4a148186806e296e]::queries::analysis, rustc_query_impl[4a148186806e296e]::plumbing::QueryCtxt>
  61:        0x10e9ff658 - <rustc_query_impl[4a148186806e296e]::Queries as rustc_middle[741ab025093759e2]::ty::query::QueryEngine>::analysis
  62:        0x10b651d18 - <rustc_middle[741ab025093759e2]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>
  63:        0x10b651688 - <rustc_interface[8543ccb9fbf59e1b]::interface::Compiler>::enter::<rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}::{closure#2}, core[48081c40cc16d56a]::result::Result<core[48081c40cc16d56a]::option::Option<rustc_interface[8543ccb9fbf59e1b]::queries::Linker>, rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>
  64:        0x10b615590 - rustc_span[6c3f9550a9acf6ff]::set_source_map::<core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>, rustc_interface[8543ccb9fbf59e1b]::interface::run_compiler<core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>, rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  65:        0x10b61ab7c - <scoped_tls[d422f7db1b3b2f94]::ScopedKey<rustc_span[6c3f9550a9acf6ff]::SessionGlobals>>::set::<rustc_interface[8543ccb9fbf59e1b]::interface::run_compiler<core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>, rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}>::{closure#0}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>
  66:        0x10b60c2a0 - std[11e8f5d0c59412da]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8543ccb9fbf59e1b]::util::run_in_thread_pool_with_globals<rustc_interface[8543ccb9fbf59e1b]::interface::run_compiler<core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>, rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}>::{closure#0}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>
  67:        0x10b61fd6c - <<std[11e8f5d0c59412da]::thread::Builder>::spawn_unchecked_<rustc_interface[8543ccb9fbf59e1b]::util::run_in_thread_pool_with_globals<rustc_interface[8543ccb9fbf59e1b]::interface::run_compiler<core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>, rustc_driver_impl[682bce9d94f8fc57]::run_compiler::{closure#1}>::{closure#0}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[48081c40cc16d56a]::result::Result<(), rustc_span[6c3f9550a9acf6ff]::ErrorGuaranteed>>::{closure#1} as core[48081c40cc16d56a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  68:        0x103147cd4 - std::sys::unix::thread::Thread::new::thread_start::h2a953b47de327ee9
  69:        0x18c20ffa8 - __pthread_joiner_wake

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.71.0-nightly (b628260df 2023-04-22) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [typeck] type-checking `test_basic`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 typeck_item_bodies(0-0)
end of try_mark_green dep node stack
error: could not compile `stream` (test "lib")
Backtrace

$ RUST_BACKTRACE=1 cargo test --features std -- --nocapture
   Compiling stream v0.1.0 (/Users/eric/git/stream-rs)
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:915:9: const parameter `C/#3` (Const { ty: usize, kind: Param(C/#3) }/3) out of range when substituting substs=['_#38r, _, chacha20poly1305::ChaChaPoly1305<aes::cipher::StreamCipherCoreWrapper<chacha20::xchacha::XChaChaCore<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UTerm, aead::consts::B1>, aead::consts::B0>, aead::consts::B1>, aead::consts::B0>>>, aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UInt<aead::generic_array::typenum::UTerm, aead::consts::B1>, aead::consts::B1>, aead::consts::B0>, aead::consts::B0>, aead::consts::B0>>]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/b628260df0587ae559253d8640ecb8738d3de613/compiler/rustc_errors/src/lib.rs:1643:9
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::HandlerInner>::bug::<&alloc::string::String>
   2: <rustc_errors::Handler>::bug::<&alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_middle::ty::subst::SubstFolder>::const_param_out_of_range
   8: <rustc_middle::ty::subst::SubstFolder as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const
   9: rustc_middle::ty::util::fold_list::<rustc_middle::ty::subst::SubstFolder, rustc_middle::ty::subst::GenericArg, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with<rustc_middle::ty::subst::SubstFolder>::{closure#0}>
  10: <rustc_middle::ty::consts::kind::ConstKind as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::subst::SubstFolder>
  11: <rustc_middle::ty::subst::SubstFolder as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const
  12: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_middle::ty::subst::SubstFolder>
  13: <rustc_middle::ty::PredicateKind as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::subst::SubstFolder>
  14: <alloc::vec::Vec<rustc_middle::ty::Predicate> as alloc::vec::spec_extend::SpecExtend<rustc_middle::ty::Predicate, core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_middle::ty::Predicate, rustc_span::span_encoding::Span)>, <rustc_middle::ty::generics::GenericPredicates>::instantiate_into::{closure#0}>>>::spec_extend
  15: <rustc_middle::ty::generics::GenericPredicates>::instantiate_into
  16: <rustc_middle::ty::generics::GenericPredicates>::instantiate
  17: <rustc_trait_selection::traits::wf::WfPredicates>::nominal_obligations_inner
  18: <rustc_trait_selection::traits::wf::WfPredicates>::compute
  19: rustc_trait_selection::traits::wf::obligations
  20: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  21: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
  22: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::resolve_vars_with_obligations
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::structurally_resolved_type
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  33: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  34: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  36: rustc_hir_typeck::check::check_fn
  37: rustc_hir_typeck::typeck
  38: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
  39: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  40: rustc_query_system::query::plumbing::force_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  41: <rustc_query_impl::plumbing::query_callback<rustc_query_impl::queries::typeck>::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind>)>>::call_once
  42: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  43: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl::plumbing::QueryCtxt>
  44: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#1}, core::option::Option<(rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core::option::Option<(rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>>
  45: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  46: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  47: rustc_hir_analysis::check_crate
  48: rustc_interface::passes::analysis
  49: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
  50: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  51: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  52: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  53: <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_span::ErrorGuaranteed>>
  54: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  55: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.71.0-nightly (b628260df 2023-04-22) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [typeck] type-checking `test_basic`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 typeck_item_bodies(0-0)
end of try_mark_green dep node stack
error: could not compile `stream` (test "lib")

@ericlagergren ericlagergren 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 May 1, 2023
@compiler-errors compiler-errors added requires-nightly This issue requires a nightly compiler in some way. F-generic_const_exprs `#![feature(generic_const_exprs)]` F-inherent_associated_types `#![feature(inherent_associated_types)]` labels May 1, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented May 1, 2023

there is no DEFAULT_CHUNK_SIZE anywhere in the linked code

@BoxyUwU
Copy link
Member

BoxyUwU commented May 1, 2023

This is probably #106994

@ericlagergren
Copy link
Author

@BoxyUwU sorry, it was

const DEFAULT_CHUNK_SIZE: usize = 65536;
[...]
pub struct Writer<'a, W, A, const C: usize = DEFAULT_CHUNK_SIZE>
[...]

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. F-generic_const_exprs `#![feature(generic_const_exprs)]` F-inherent_associated_types `#![feature(inherent_associated_types)]` 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

3 participants