rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.64k stars 12.49k forks source link

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

Open is8ac opened 1 year ago

is8ac commented 1 year ago

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 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable 3: ::process_obligation 4: >::process_obligations:: 5: ::select_where_possible 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_argument_types 9: ::check_call 10: ::check_expr_with_expectation_and_args 11: ::check_argument_types 12: ::check_call 13: ::check_expr_with_expectation_and_args 14: ::check_decl 15: ::check_block_with_expected 16: ::check_expr_with_expectation_and_args 17: ::check_return_expr 18: rustc_hir_typeck::check::check_fn 19: rustc_hir_typeck::typeck 20: rustc_query_system::query::plumbing::try_execute_query:: 21: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 22: rustc_hir_typeck::typeck_item_bodies 23: rustc_query_system::query::plumbing::try_execute_query:: 24: ::typeck_item_bodies 25: ::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:: 29: ::analysis 30: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 31: ::enter::, rustc_span::ErrorGuaranteed>> 32: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 33: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 37: as core::ops::function::FnOnce>::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: 40: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable 3: ::process_obligation 4: >::process_obligations:: 5: ::select_where_possible 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_argument_types 9: ::check_call 10: ::check_expr_with_expectation_and_args 11: ::check_argument_types 12: ::check_call 13: ::check_expr_with_expectation_and_args 14: ::check_decl 15: ::check_block_with_expected 16: ::check_expr_with_expectation_and_args 17: ::check_return_expr 18: rustc_hir_typeck::check::check_fn 19: rustc_hir_typeck::typeck 20: rustc_query_system::query::plumbing::try_execute_query:: 21: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 22: rustc_hir_typeck::typeck_item_bodies 23: rustc_query_system::query::plumbing::try_execute_query:: 24: ::typeck_item_bodies 25: ::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:: 29: ::analysis 30: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 31: ::enter::, rustc_span::ErrorGuaranteed>> 32: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 33: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 37: as core::ops::function::FnOnce>::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: 40: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_selection_error 3: ::report_fulfillment_error 4: ::report_fulfillment_errors 5: ::check_call 6: ::check_expr_with_expectation_and_args 7: ::check_argument_types 8: ::check_call 9: ::check_expr_with_expectation_and_args 10: ::check_argument_types 11: ::check_call 12: ::check_expr_with_expectation_and_args 13: ::check_decl 14: ::check_block_with_expected 15: ::check_expr_with_expectation_and_args 16: ::check_return_expr 17: rustc_hir_typeck::check::check_fn 18: rustc_hir_typeck::typeck 19: rustc_query_system::query::plumbing::try_execute_query:: 20: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 21: rustc_hir_typeck::typeck_item_bodies 22: rustc_query_system::query::plumbing::try_execute_query:: 23: ::typeck_item_bodies 24: ::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:: 28: ::analysis 29: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 30: ::enter::, rustc_span::ErrorGuaranteed>> 31: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 32: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 36: as core::ops::function::FnOnce>::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: 39: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_selection_error 3: ::report_fulfillment_error 4: ::report_fulfillment_errors 5: ::check_call 6: ::check_expr_with_expectation_and_args 7: ::check_argument_types 8: ::check_call 9: ::check_expr_with_expectation_and_args 10: ::check_argument_types 11: ::check_call 12: ::check_expr_with_expectation_and_args 13: ::check_decl 14: ::check_block_with_expected 15: ::check_expr_with_expectation_and_args 16: ::check_return_expr 17: rustc_hir_typeck::check::check_fn 18: rustc_hir_typeck::typeck 19: rustc_query_system::query::plumbing::try_execute_query:: 20: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 21: rustc_hir_typeck::typeck_item_bodies 22: rustc_query_system::query::plumbing::try_execute_query:: 23: ::typeck_item_bodies 24: ::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:: 28: ::analysis 29: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 30: ::enter::, rustc_span::ErrorGuaranteed>> 31: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 32: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 36: as core::ops::function::FnOnce>::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: 39: error: internal compiler error: expected fullfillment errors | = note: delayed at 0: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_fulfillment_errors 3: ::check_call 4: ::check_expr_with_expectation_and_args 5: ::check_argument_types 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_argument_types 9: ::check_call 10: ::check_expr_with_expectation_and_args 11: ::check_decl 12: ::check_block_with_expected 13: ::check_expr_with_expectation_and_args 14: ::check_return_expr 15: rustc_hir_typeck::check::check_fn 16: rustc_hir_typeck::typeck 17: rustc_query_system::query::plumbing::try_execute_query:: 18: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 19: rustc_hir_typeck::typeck_item_bodies 20: rustc_query_system::query::plumbing::try_execute_query:: 21: ::typeck_item_bodies 22: ::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:: 26: ::analysis 27: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 28: ::enter::, rustc_span::ErrorGuaranteed>> 29: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 30: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 34: as core::ops::function::FnOnce>::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: 37: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable 3: ::process_obligation 4: >::process_obligations:: 5: ::check_argument_types 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_decl 9: ::check_block_with_expected 10: ::check_expr_with_expectation_and_args 11: ::check_return_expr 12: rustc_hir_typeck::check::check_fn 13: rustc_hir_typeck::typeck 14: rustc_query_system::query::plumbing::try_execute_query:: 15: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 16: rustc_hir_typeck::typeck_item_bodies 17: rustc_query_system::query::plumbing::try_execute_query:: 18: ::typeck_item_bodies 19: ::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:: 23: ::analysis 24: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 25: ::enter::, rustc_span::ErrorGuaranteed>> 26: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 27: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 31: as core::ops::function::FnOnce>::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: 34: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable 3: ::process_obligation 4: >::process_obligations:: 5: ::check_argument_types 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_decl 9: ::check_block_with_expected 10: ::check_expr_with_expectation_and_args 11: ::check_return_expr 12: rustc_hir_typeck::check::check_fn 13: rustc_hir_typeck::typeck 14: rustc_query_system::query::plumbing::try_execute_query:: 15: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 16: rustc_hir_typeck::typeck_item_bodies 17: rustc_query_system::query::plumbing::try_execute_query:: 18: ::typeck_item_bodies 19: ::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:: 23: ::analysis 24: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 25: ::enter::, rustc_span::ErrorGuaranteed>> 26: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 27: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 31: as core::ops::function::FnOnce>::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: 34: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_selection_error 3: ::report_fulfillment_error 4: ::report_fulfillment_errors 5: ::check_argument_types 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_decl 9: ::check_block_with_expected 10: ::check_expr_with_expectation_and_args 11: ::check_return_expr 12: rustc_hir_typeck::check::check_fn 13: rustc_hir_typeck::typeck 14: rustc_query_system::query::plumbing::try_execute_query:: 15: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 16: rustc_hir_typeck::typeck_item_bodies 17: rustc_query_system::query::plumbing::try_execute_query:: 18: ::typeck_item_bodies 19: ::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:: 23: ::analysis 24: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 25: ::enter::, rustc_span::ErrorGuaranteed>> 26: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 27: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 31: as core::ops::function::FnOnce>::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: 34: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_selection_error 3: ::report_fulfillment_error 4: ::report_fulfillment_errors 5: ::check_argument_types 6: ::check_call 7: ::check_expr_with_expectation_and_args 8: ::check_decl 9: ::check_block_with_expected 10: ::check_expr_with_expectation_and_args 11: ::check_return_expr 12: rustc_hir_typeck::check::check_fn 13: rustc_hir_typeck::typeck 14: rustc_query_system::query::plumbing::try_execute_query:: 15: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 16: rustc_hir_typeck::typeck_item_bodies 17: rustc_query_system::query::plumbing::try_execute_query:: 18: ::typeck_item_bodies 19: ::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:: 23: ::analysis 24: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 25: ::enter::, rustc_span::ErrorGuaranteed>> 26: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 27: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 31: as core::ops::function::FnOnce>::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: 34: error: internal compiler error: expected fullfillment errors | = note: delayed at 0: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::report_fulfillment_errors 3: ::check_argument_types 4: ::check_call 5: ::check_expr_with_expectation_and_args 6: ::check_decl 7: ::check_block_with_expected 8: ::check_expr_with_expectation_and_args 9: ::check_return_expr 10: rustc_hir_typeck::check::check_fn 11: rustc_hir_typeck::typeck 12: rustc_query_system::query::plumbing::try_execute_query:: 13: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 14: rustc_hir_typeck::typeck_item_bodies 15: rustc_query_system::query::plumbing::try_execute_query:: 16: ::typeck_item_bodies 17: ::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:: 21: ::analysis 22: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 23: ::enter::, rustc_span::ErrorGuaranteed>> 24: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 25: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 29: as core::ops::function::FnOnce>::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: 32: 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: ::emit_diagnostic 1: ::delay_span_bug:: 2: ::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:: 7: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 8: ::time::<(), rustc_interface::passes::analysis::{closure#2}> 9: rustc_interface::passes::analysis 10: rustc_query_system::query::plumbing::try_execute_query:: 11: ::analysis 12: >>::with::::enter>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> 13: ::enter::, rustc_span::ErrorGuaranteed>> 14: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 15: >::set::, 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_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: <::spawn_unchecked_, 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: as core::ops::function::FnOnce>::call_once at /rustc/84dd17b56a931a631a23dfd5ef2018fd3ef49108/library/alloc/src/boxed.rs:1973:9 19: as core::ops::function::FnOnce>::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: 22: 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 ```

matthiaskrgr commented 1 year ago

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

searched toolchains 8681d4cffcd23bbe619984ab62772a91827a40dc through 80a96467ec5675e9f69683b5c075a8b15950c341

Regression in aff003becd8b6bf803202e958623031274ad69c9

99798 cc @JulianKnodt