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: Missing value for constant, but no error reported? #110378

Open
is8ac opened this issue Apr 15, 2023 · 1 comment
Open

ICE: Missing value for constant, but no error reported? #110378

is8ac opened this issue Apr 15, 2023 · 1 comment
Labels
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) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@is8ac
Copy link

is8ac commented Apr 15, 2023

Code

#![feature(generic_const_exprs)]

fn foo<const L: usize>(_a: [u8; L], _b: [u8; L]) -> [u8; L + 1] {
    [0_u8; L + 1]
}

fn main() {
    let baz = [[0_u8; 1]; 8];

    let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
    //let _: [u8; 3] = foo(foo(baz[0], baz[1]), foo(baz[2], baz[3]));
}

As shown in the commented line, two levels of nesting compiles, three does not.

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (84dd17b56 2023-04-14)
binary: rustc
commit-hash: 84dd17b56a931a631a23dfd5ef2018fd3ef49108
commit-date: 2023-04-14
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.2
Error

$ rustc src/bin/ice3_demo.rs 
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> src/bin/ice3_demo.rs:1:12
  |
1 | #![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

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: Missing value for constant, but no error reported?
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
              3: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
              4: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
              5: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
             15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             18: rustc_hir_typeck::check::check_fn
             19: rustc_hir_typeck::typeck
             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::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             25: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             26: rustc_hir_analysis::check_crate
             27: rustc_interface::passes::analysis
             28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             29: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             30: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             31: <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>>
             32: 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}>
             33: <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>>
             34: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             35: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             37: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             38: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             39: <unknown>
             40: <unknown>
           

error: internal compiler error: evaluating `ConstKind::Expr` is not currently supported
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
              3: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
              4: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
              5: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
             15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             18: rustc_hir_typeck::check::check_fn
             19: rustc_hir_typeck::typeck
             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::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             25: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             26: rustc_hir_analysis::check_crate
             27: rustc_interface::passes::analysis
             28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             29: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             30: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             31: <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>>
             32: 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}>
             33: <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>>
             34: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             35: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             37: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             38: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             39: <unknown>
             40: <unknown>
           

error: internal compiler error: `report_selection_error` did not emit an error
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
              3: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
              4: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
             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::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             20: 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}>
             21: rustc_hir_typeck::typeck_item_bodies
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             24: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             25: rustc_hir_analysis::check_crate
             26: rustc_interface::passes::analysis
             27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             28: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             29: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             30: <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>>
             31: 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}>
             32: <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>>
             33: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             34: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             35: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             37: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             38: <unknown>
             39: <unknown>
           

error: internal compiler error: `ErrorGuaranteed` without an error
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
              3: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
              4: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
             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::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             20: 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}>
             21: rustc_hir_typeck::typeck_item_bodies
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             24: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             25: rustc_hir_analysis::check_crate
             26: rustc_interface::passes::analysis
             27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             28: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             29: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             30: <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>>
             31: 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}>
             32: <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>>
             33: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             34: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             35: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             37: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             38: <unknown>
             39: <unknown>
           

error: internal compiler error: expected fullfillment errors
  |
  = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
             3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
            10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
            11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
            12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
            13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
            14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
            15: rustc_hir_typeck::check::check_fn
            16: rustc_hir_typeck::typeck
            17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            18: 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}>
            19: rustc_hir_typeck::typeck_item_bodies
            20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
            21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
            22: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
            23: rustc_hir_analysis::check_crate
            24: rustc_interface::passes::analysis
            25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            27: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            28: <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>>
            29: 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}>
            30: <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>>
            31: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            32: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            33: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            34: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            35: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
            36: <unknown>
            37: <unknown>
          

error: internal compiler error: Missing value for constant, but no error reported?
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
              3: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
              4: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             12: rustc_hir_typeck::check::check_fn
             13: rustc_hir_typeck::typeck
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             15: 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}>
             16: rustc_hir_typeck::typeck_item_bodies
             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             19: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             20: rustc_hir_analysis::check_crate
             21: rustc_interface::passes::analysis
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             25: <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>>
             26: 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}>
             27: <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>>
             28: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             29: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             32: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             33: <unknown>
             34: <unknown>
           

error: internal compiler error: evaluating `ConstKind::Expr` is not currently supported
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
              3: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
              4: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             12: rustc_hir_typeck::check::check_fn
             13: rustc_hir_typeck::typeck
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             15: 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}>
             16: rustc_hir_typeck::typeck_item_bodies
             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             19: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             20: rustc_hir_analysis::check_crate
             21: rustc_interface::passes::analysis
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             25: <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>>
             26: 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}>
             27: <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>>
             28: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             29: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             32: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             33: <unknown>
             34: <unknown>
           

error: internal compiler error: `report_selection_error` did not emit an error
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
              3: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
              4: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             12: rustc_hir_typeck::check::check_fn
             13: rustc_hir_typeck::typeck
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             15: 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}>
             16: rustc_hir_typeck::typeck_item_bodies
             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             19: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             20: rustc_hir_analysis::check_crate
             21: rustc_interface::passes::analysis
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             25: <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>>
             26: 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}>
             27: <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>>
             28: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             29: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             32: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             33: <unknown>
             34: <unknown>
           

error: internal compiler error: `ErrorGuaranteed` without an error
  --> src/bin/ice3_demo.rs:10:73
   |
10 |     let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7])));
   |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
              1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
              3: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
              4: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
              5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
              6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
              7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
              8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
              9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             12: rustc_hir_typeck::check::check_fn
             13: rustc_hir_typeck::typeck
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             15: 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}>
             16: rustc_hir_typeck::typeck_item_bodies
             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             19: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             20: rustc_hir_analysis::check_crate
             21: rustc_interface::passes::analysis
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             25: <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>>
             26: 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}>
             27: <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>>
             28: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             29: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
             32: std::sys::unix::thread::Thread::new::thread_start
                        at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
             33: <unknown>
             34: <unknown>
           

error: internal compiler error: expected fullfillment errors
  |
  = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
             3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
             4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
             5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
             7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
            10: rustc_hir_typeck::check::check_fn
            11: rustc_hir_typeck::typeck
            12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            13: 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}>
            14: rustc_hir_typeck::typeck_item_bodies
            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::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            22: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            23: <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>>
            24: 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}>
            25: <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>>
            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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::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/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            29: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            30: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
            31: <unknown>
            32: <unknown>
          

<truncated to fit in Github comment limit>

error: internal compiler error: broken MIR in DefId(0:9 ~ ice3_demo[6971]::main) (LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: [type error], user_ty: None, source_info: SourceInfo { span: src/bin/ice3_demo.rs:7:1: 7:10 (#0), scope: scope[0] } }): bad type [type error]
 --> src/bin/ice3_demo.rs:7:1
  |
7 | fn main() {
  | ^^^^^^^^^
  |
  = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             2: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
             3: rustc_borrowck::nll::compute_regions
             4: rustc_borrowck::do_mir_borrowck
             5: rustc_borrowck::mir_borrowck
             6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             7: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             8: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             9: rustc_interface::passes::analysis
            10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            12: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            13: <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>>
            14: 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}>
            15: <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>>
            16: 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_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            17: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<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>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9
            20: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/std/src/sys/unix/thread.rs:108:17
            21: <unknown>
            22: <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.70.0-nightly (84dd17b56 2023-04-14) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 14 previous errors; 1 warning emitted

@is8ac is8ac 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 Apr 15, 2023
@jyn514 jyn514 changed the title error: internal compiler error: no errors encountered even though delay_span_bug issued ICE: Missing value for constant, but no error reported? Apr 15, 2023
@jyn514 jyn514 added the F-generic_const_exprs `#![feature(generic_const_exprs)]` label Apr 15, 2023
@matthiaskrgr
Copy link
Member

searched toolchains nightly-2022-11-19 through nightly-2023-04-16
Regression in nightly-2022-11-27

searched toolchains 8681d4c through 80a9646

Regression in aff003b

#99798 cc @JulianKnodt

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)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. 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