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: panicked at Normalizing binder without wrapping in a Binder #111417

Closed
matthiaskrgr opened this issue May 10, 2023 · 1 comment
Closed

ICE: panicked at Normalizing binder without wrapping in a Binder #111417

matthiaskrgr opened this issue May 10, 2023 · 1 comment
Labels
C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(generic_const_exprs)]

trait MyTrait<T> {}

fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
    todo!()
}

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (2f6bc5d25 2023-05-09)
binary: rustc
commit-hash: 2f6bc5d259e7ab25ddfdd33de53b892770218918
commit-date: 2023-05-09
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

<output>
Backtrace

thread 'rustc' panicked at 'Normalizing Binder(([&'a u32]; c_variadic: false)->_, []) without wrapping in a `Binder`', /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/compiler/rustc_trait_selection/src/traits/project.rs:442:9
stack backtrace:
   0:     0x7f936636a481 - std::backtrace_rs::backtrace::libunwind::trace::h28494931c73179b2
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f936636a481 - std::backtrace_rs::backtrace::trace_unsynchronized::h9032c52edccf7bd1
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f936636a481 - std::sys_common::backtrace::_print_fmt::hd90562e967f4e4e1
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f936636a481 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h113657117676131e
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f93663ca84f - core::fmt::rt::Argument::fmt::hd56cdfa11c364505
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/core/src/fmt/rt.rs:138:9
   5:     0x7f93663ca84f - core::fmt::write::h24c20284e5d6be9e
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f936635d6e1 - std::io::Write::write_fmt::hbf02c94f0e7342d1
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/io/mod.rs:1712:15
   7:     0x7f936636a295 - std::sys_common::backtrace::_print::he85212e2c716c859
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f936636a295 - std::sys_common::backtrace::print::h888aaf3ad10f084e
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f936636cf17 - std::panicking::default_hook::{{closure}}::hba0edb58dc223add
  10:     0x7f936636cd04 - std::panicking::default_hook::h1555b8bada2010d7
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/panicking.rs:288:9
  11:     0x7f93695d593b - <rustc_driver_impl[c1e8e7e9cc0f0224]::install_ice_hook::{closure#0} as core[75e04f0db769f8d6]::ops::function::FnOnce<(&core[75e04f0db769f8d6]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f936636d637 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h07438796673f3d04
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/alloc/src/boxed.rs:1999:9
  13:     0x7f936636d637 - std::panicking::rust_panic_with_hook::h72a06453beb2cbcb
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/panicking.rs:695:13
  14:     0x7f936636d3b7 - std::panicking::begin_panic_handler::{{closure}}::h0281d6cc05cfd2a4
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/panicking.rs:582:13
  15:     0x7f936636a8c6 - std::sys_common::backtrace::__rust_end_short_backtrace::h1c79565770be27d9
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f936636d122 - rust_begin_unwind
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/panicking.rs:578:5
  17:     0x7f93663c6ad3 - core::panicking::panic_fmt::he6a2fe7a1b635de3
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/core/src/panicking.rs:67:14
  18:     0x7f9367b908e1 - <rustc_trait_selection[430f5fa6108926ed]::traits::project::AssocTypeNormalizer>::fold::<rustc_middle[8c6563ccb890ccc7]::ty::sty::Binder<rustc_middle[8c6563ccb890ccc7]::ty::sty::FnSig>>
  19:     0x7f9367b903c7 - rustc_trait_selection[430f5fa6108926ed]::traits::project::normalize_with_depth::<rustc_middle[8c6563ccb890ccc7]::ty::sty::Binder<rustc_middle[8c6563ccb890ccc7]::ty::sty::FnSig>>
  20:     0x7f9367b8f9bc - <rustc_infer[357c8b9868401c27]::infer::at::At as rustc_trait_selection[430f5fa6108926ed]::traits::project::NormalizeExt>::normalize::<rustc_middle[8c6563ccb890ccc7]::ty::sty::Binder<rustc_middle[8c6563ccb890ccc7]::ty::sty::FnSig>>
  21:     0x7f9367b8f891 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::normalize::<rustc_middle[8c6563ccb890ccc7]::ty::sty::Binder<rustc_middle[8c6563ccb890ccc7]::ty::sty::FnSig>>
  22:     0x7f9367b8f0e0 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::supplied_sig_of_closure
  23:     0x7f9367b8a370 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::check_expr_closure
  24:     0x7f9367b026fc - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:     0x7f9367b474e0 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::check_block_with_expected
  26:     0x7f9367afee09 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7f9367b0cd70 - <rustc_hir_typeck[7fb44c8b93f9310b]::fn_ctxt::FnCtxt>::check_expr_coercible_to_type
  28:     0x7f9367c1142c - rustc_hir_typeck[7fb44c8b93f9310b]::typeck
  29:     0x7f9367c06d32 - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::typeck, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  30:     0x7f9367c069c5 - rustc_query_impl[677774657eb92e7b]::get_query::typeck
  31:     0x7f9367f45e8b - rustc_mir_build[9b43786a7326c032]::thir::cx::thir_body
  32:     0x7f9367f43fcc - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::thir_body, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  33:     0x7f9367f43c65 - rustc_query_impl[677774657eb92e7b]::get_query::thir_body
  34:     0x7f93686598b6 - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::thir_abstract_const, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  35:     0x7f936865846a - rustc_query_impl[677774657eb92e7b]::get_query::thir_abstract_const
  36:     0x7f9368a5f212 - rustc_middle[8c6563ccb890ccc7]::ty::query::query_get_at::<rustc_query_system[ffc3e6874545e2cc]::query::caches::DefaultCache<rustc_span[f344ead202b2f728]::def_id::DefId, rustc_middle[8c6563ccb890ccc7]::query::erase::Erased<[u8; 16usize]>>>
  37:     0x7f9367662a38 - <<rustc_middle[8c6563ccb890ccc7]::ty::context::TyCtxt>::expand_abstract_consts::Expander as rustc_type_ir[a2a3eb09eb372e2d]::fold::TypeFolder<rustc_middle[8c6563ccb890ccc7]::ty::context::TyCtxt>>::fold_const
  38:     0x7f9367829887 - rustc_trait_selection[430f5fa6108926ed]::traits::const_evaluatable::is_const_evaluatable
  39:     0x7f93677bc0d2 - <rustc_trait_selection[430f5fa6108926ed]::traits::fulfill::FulfillProcessor as rustc_data_structures[78003e5995acb4f0]::obligation_forest::ObligationProcessor>::process_obligation
  40:     0x7f93677b17c4 - <rustc_data_structures[78003e5995acb4f0]::obligation_forest::ObligationForest<rustc_trait_selection[430f5fa6108926ed]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[430f5fa6108926ed]::traits::fulfill::FulfillProcessor>
  41:     0x7f936793f62b - <rustc_trait_selection[430f5fa6108926ed]::traits::engine::ObligationCtxt>::select_all_or_error
  42:     0x7f93680e11c7 - rustc_hir_analysis[22ad3c510546d4fc]::check::wfcheck::check_item_fn
  43:     0x7f93680dd6ea - rustc_hir_analysis[22ad3c510546d4fc]::check::wfcheck::check_well_formed
  44:     0x7f9367970403 - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::check_well_formed, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  45:     0x7f93689b15e7 - rustc_data_structures[78003e5995acb4f0]::sync::par_for_each_in::<&[rustc_hir[98be715f7d0986d7]::hir::ItemId], <rustc_middle[8c6563ccb890ccc7]::hir::ModuleItems>::par_items<rustc_hir_analysis[22ad3c510546d4fc]::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>
  46:     0x7f93689b11fa - rustc_hir_analysis[22ad3c510546d4fc]::check::wfcheck::check_mod_type_wf
  47:     0x7f9368c33dc1 - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::check_mod_type_wf, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  48:     0x7f9368c33a01 - rustc_query_impl[677774657eb92e7b]::get_query::check_mod_type_wf
  49:     0x7f9368a03b97 - rustc_data_structures[78003e5995acb4f0]::sync::par_for_each_in::<&[rustc_hir[98be715f7d0986d7]::hir_id::OwnerId], <rustc_middle[8c6563ccb890ccc7]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[22ad3c510546d4fc]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  50:     0x7f9368a00b17 - rustc_hir_analysis[22ad3c510546d4fc]::check_crate
  51:     0x7f93689f43c0 - rustc_interface[e0c448f9df8a7367]::passes::analysis
  52:     0x7f9368d421f7 - rustc_query_system[ffc3e6874545e2cc]::query::plumbing::try_execute_query::<rustc_query_impl[677774657eb92e7b]::queries::analysis, rustc_query_impl[677774657eb92e7b]::plumbing::QueryCtxt>
  53:     0x7f9368d41f13 - rustc_query_impl[677774657eb92e7b]::get_query::analysis
  54:     0x7f93687c4d8f - <rustc_middle[8c6563ccb890ccc7]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[c1e8e7e9cc0f0224]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>>
  55:     0x7f93687c3e6f - <rustc_interface[e0c448f9df8a7367]::interface::Compiler>::enter::<rustc_driver_impl[c1e8e7e9cc0f0224]::run_compiler::{closure#1}::{closure#2}, core[75e04f0db769f8d6]::result::Result<core[75e04f0db769f8d6]::option::Option<rustc_interface[e0c448f9df8a7367]::queries::Linker>, rustc_span[f344ead202b2f728]::ErrorGuaranteed>>
  56:     0x7f93687c150b - std[9a33fd118bee7e76]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e0c448f9df8a7367]::util::run_in_thread_pool_with_globals<rustc_interface[e0c448f9df8a7367]::interface::run_compiler<core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>, rustc_driver_impl[c1e8e7e9cc0f0224]::run_compiler::{closure#1}>::{closure#0}, core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>>
  57:     0x7f9368eab7c5 - <<std[9a33fd118bee7e76]::thread::Builder>::spawn_unchecked_<rustc_interface[e0c448f9df8a7367]::util::run_in_thread_pool_with_globals<rustc_interface[e0c448f9df8a7367]::interface::run_compiler<core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>, rustc_driver_impl[c1e8e7e9cc0f0224]::run_compiler::{closure#1}>::{closure#0}, core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[75e04f0db769f8d6]::result::Result<(), rustc_span[f344ead202b2f728]::ErrorGuaranteed>>::{closure#1} as core[75e04f0db769f8d6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  58:     0x7f9366377ae5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h71c821b130855373
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/alloc/src/boxed.rs:1985:9
  59:     0x7f9366377ae5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1701cec9acb1061c
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/alloc/src/boxed.rs:1985:9
  60:     0x7f9366377ae5 - std::sys::unix::thread::Thread::new::thread_start::h6dd5ef62dde103f1
                               at /rustc/2f6bc5d259e7ab25ddfdd33de53b892770218918/library/std/src/sys/unix/thread.rs:108:17
  61:     0x7f9366114bb5 - <unknown>
  62:     0x7f9366196d90 - <unknown>
  63:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.71.0-nightly (2f6bc5d25 2023-05-09) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `bug::{constant#0}`
#1 [thir_body] building THIR for `bug::{constant#0}`
#2 [thir_abstract_const] building an abstract representation for `bug::{constant#0}`
#3 [check_well_formed] checking that `bug` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0601`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels May 10, 2023
@Noratrieb Noratrieb added requires-nightly This issue requires a nightly compiler in some way. F-generic_const_exprs `#![feature(generic_const_exprs)]` requires-incomplete-features This issue requires the use of incomplete features. labels May 10, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented May 10, 2023

dupe of #77357

@BoxyUwU BoxyUwU closed this as completed May 10, 2023
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)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features This issue requires the use of incomplete features. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants