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: ConstArgHasType(^0, usize) has escaping bound vars, so it cannot be wrapped in a dummy binder. #127970

Closed
matthiaskrgr opened this issue Jul 19, 2024 · 2 comments · Fixed by #128020
Labels
C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

original:

#![feature(non_lifetime_binders)]

fn walk2<'a, T: 'a>(_: T)
where
    for<const C: usize> [(); C]: 'a, 
{}

fn main() {}

Version information

rustc 1.81.0-nightly (11e57241f 2024-07-19)
binary: rustc
commit-hash: 11e57241f166194a328438d9264b68c98a18d51f
commit-date: 2024-07-19
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> 120860.rs:1:12
  |
1 | #![feature(non_lifetime_binders)]
  |            ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
  = note: `#[warn(incomplete_features)]` on by default

thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/wf.rs:685:21:
`ConstArgHasType(^0, usize)` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
   0:     0x79ae54e81125 - std::backtrace_rs::backtrace::libunwind::trace::hf98a5915ebb35e48
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x79ae54e81125 - std::backtrace_rs::backtrace::trace_unsynchronized::hd655af97e2fd6730
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x79ae54e81125 - std::sys::backtrace::_print_fmt::h621db2f84bb6c977
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/sys/backtrace.rs:65:5
   3:     0x79ae54e81125 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h15411039d8520454
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/sys/backtrace.rs:40:26
   4:     0x79ae54ed0c2b - core::fmt::rt::Argument::fmt::h67bd01cd3519872c
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/core/src/fmt/rt.rs:173:76
   5:     0x79ae54ed0c2b - core::fmt::write::hadd1ce33df102529
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/core/src/fmt/mod.rs:1182:21
   6:     0x79ae54e75bff - std::io::Write::write_fmt::h2f869538ed52830c
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/io/mod.rs:1827:15
   7:     0x79ae54e83911 - std::sys::backtrace::BacktraceLock::print::hbc3230efeae1e486
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/sys/backtrace.rs:43:9
   8:     0x79ae54e83911 - std::panicking::default_hook::{{closure}}::h218c8d9fd7d09778
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/panicking.rs:269:22
   9:     0x79ae54e835ec - std::panicking::default_hook::hb07cda98c1c69610
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/panicking.rs:296:9
  10:     0x79ae5122d86a - std[6b173760e3c5fb6]::panicking::update_hook::<alloc[90d8a7b433d20df0]::boxed::Box<rustc_driver_impl[25cb91e50f1896ac]::install_ice_hook::{closure#0}>>::{closure#0}
  11:     0x79ae54e842df - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h47aca6625104f576
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/alloc/src/boxed.rs:2084:9
  12:     0x79ae54e842df - std::panicking::rust_panic_with_hook::h4eb1d6a88426bb57
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/panicking.rs:808:13
  13:     0x79ae54e83f07 - std::panicking::begin_panic_handler::{{closure}}::h061f8898eb3a2216
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/panicking.rs:674:13
  14:     0x79ae54e815e9 - std::sys::backtrace::__rust_end_short_backtrace::h61e77cb542bf7706
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/sys/backtrace.rs:168:18
  15:     0x79ae54e83b94 - rust_begin_unwind
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/panicking.rs:665:5
  16:     0x79ae54ecd1e3 - core::panicking::panic_fmt::hcb681182948762cb
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/core/src/panicking.rs:74:14
  17:     0x79ae53e5998c - <rustc_type_ir[f96864cd1999cfdb]::binder::Binder<rustc_middle[d4947050f46ff72a]::ty::context::TyCtxt, rustc_type_ir[f96864cd1999cfdb]::predicate_kind::PredicateKind<rustc_middle[d4947050f46ff72a]::ty::context::TyCtxt>>>::dummy.cold
  18:     0x79ae4f008d5b - <rustc_trait_selection[1026606f0fca5836]::traits::wf::WfPredicates as rustc_type_ir[f96864cd1999cfdb]::visit::TypeVisitor<rustc_middle[d4947050f46ff72a]::ty::context::TyCtxt>>::visit_ty
  19:     0x79ae52d96549 - rustc_trait_selection[1026606f0fca5836]::traits::wf::clause_obligations
  20:     0x79ae52d9309b - rustc_hir_analysis[67f94dc96106c366]::check::wfcheck::check_where_clauses
  21:     0x79ae52d9f4b4 - rustc_hir_analysis[67f94dc96106c366]::check::wfcheck::check_fn_or_method
  22:     0x79ae52da192b - rustc_hir_analysis[67f94dc96106c366]::check::wfcheck::check_item_fn
  23:     0x79ae4fdac34f - rustc_hir_analysis[67f94dc96106c366]::check::wfcheck::check_well_formed
  24:     0x79ae52f7f1c7 - rustc_query_impl[dfa85d359d8bf55f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[dfa85d359d8bf55f]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>
  25:     0x79ae52f7f43f - rustc_query_system[5fd7963a6e62591]::query::plumbing::try_execute_query::<rustc_query_impl[dfa85d359d8bf55f]::DynamicConfig<rustc_query_system[5fd7963a6e62591]::query::caches::VecCache<rustc_hir[6b88011788635e50]::hir_id::OwnerId, rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[dfa85d359d8bf55f]::plumbing::QueryCtxt, false>
  26:     0x79ae52f7f1a0 - rustc_query_impl[dfa85d359d8bf55f]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  27:     0x79ae52f7fe6d - rustc_hir_analysis[67f94dc96106c366]::check::wfcheck::check_mod_type_wf
  28:     0x79ae52f7fca3 - rustc_query_impl[dfa85d359d8bf55f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[dfa85d359d8bf55f]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>
  29:     0x79ae535b8af8 - rustc_query_system[5fd7963a6e62591]::query::plumbing::try_execute_query::<rustc_query_impl[dfa85d359d8bf55f]::DynamicConfig<rustc_query_system[5fd7963a6e62591]::query::caches::DefaultCache<rustc_span[bca8f273264d3c53]::def_id::LocalModDefId, rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[dfa85d359d8bf55f]::plumbing::QueryCtxt, false>
  30:     0x79ae535b88a9 - rustc_query_impl[dfa85d359d8bf55f]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  31:     0x79ae52bd5313 - rustc_hir_analysis[67f94dc96106c366]::check_crate
  32:     0x79ae52bcbd95 - rustc_interface[e83b188aca6a6213]::passes::analysis
  33:     0x79ae52bcb947 - rustc_query_impl[dfa85d359d8bf55f]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[dfa85d359d8bf55f]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>
  34:     0x79ae536c3965 - rustc_query_system[5fd7963a6e62591]::query::plumbing::try_execute_query::<rustc_query_impl[dfa85d359d8bf55f]::DynamicConfig<rustc_query_system[5fd7963a6e62591]::query::caches::SingleCache<rustc_middle[d4947050f46ff72a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[dfa85d359d8bf55f]::plumbing::QueryCtxt, false>
  35:     0x79ae536c36cf - rustc_query_impl[dfa85d359d8bf55f]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36:     0x79ae535e8a05 - rustc_interface[e83b188aca6a6213]::interface::run_compiler::<core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>, rustc_driver_impl[25cb91e50f1896ac]::run_compiler::{closure#0}>::{closure#1}
  37:     0x79ae535a1749 - std[6b173760e3c5fb6]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e83b188aca6a6213]::util::run_in_thread_with_globals<rustc_interface[e83b188aca6a6213]::util::run_in_thread_pool_with_globals<rustc_interface[e83b188aca6a6213]::interface::run_compiler<core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>, rustc_driver_impl[25cb91e50f1896ac]::run_compiler::{closure#0}>::{closure#1}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>::{closure#0}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>
  38:     0x79ae535a14fa - <<std[6b173760e3c5fb6]::thread::Builder>::spawn_unchecked_<rustc_interface[e83b188aca6a6213]::util::run_in_thread_with_globals<rustc_interface[e83b188aca6a6213]::util::run_in_thread_pool_with_globals<rustc_interface[e83b188aca6a6213]::interface::run_compiler<core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>, rustc_driver_impl[25cb91e50f1896ac]::run_compiler::{closure#0}>::{closure#1}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>::{closure#0}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9625cf1cb95ebe7c]::result::Result<(), rustc_span[bca8f273264d3c53]::ErrorGuaranteed>>::{closure#2} as core[9625cf1cb95ebe7c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x79ae54e8e33b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd3e0782f209a59bb
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/alloc/src/boxed.rs:2070:9
  40:     0x79ae54e8e33b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2ffe75b9a73fa277
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/alloc/src/boxed.rs:2070:9
  41:     0x79ae54e8e33b - std::sys::pal::unix::thread::Thread::new::thread_start::he38da8e39f41a015
                               at /rustc/11e57241f166194a328438d9264b68c98a18d51f/library/std/src/sys/pal/unix/thread.rs:108:17
  42:     0x79ae54c22ded - <unknown>
  43:     0x79ae54ca60dc - <unknown>
  44:                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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-07-19T15_54_49-2164713.txt` to your bug report

query stack during panic:
#0 [check_well_formed] checking that `walk2` is well-formed
#1 [check_mod_type_wf] checking that types are well-formed in top-level module
end of query stack
warning: 1 warning emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: ty::ConstKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:360:32 - disabled backtrace

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

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-07-19T15_54_49-2164713.txt` to your bug report

query stack during panic:
end of query stack
thread 'rustc' panicked at library/core/src/panicking.rs:229:5:
panic in a destructor during cleanup

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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-07-19T15_54_49-2164713.txt` to your bug report

query stack during panic:
end of query stack
thread caused non-unwinding panic. aborting.
[1]    2164713 IOT instruction  ~/.rustup/toolchains/master/bin/rustc 120860.rs

@rustbot label +F-non_lifetime_binders

@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 Jul 19, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` labels Jul 19, 2024
@fmease
Copy link
Member

fmease commented Jul 20, 2024

strongly relates to #127009

@GrigorenkoPV
Copy link
Contributor

Regression in #125915

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 21, 2024
…xyUwU

Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes rust-lang#127970
Fixes rust-lang#127009

r? `@BoxyUwU`
@bors bors closed this as completed in 2ef7699 Jul 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 22, 2024
Rollup merge of rust-lang#128020 - compiler-errors:nlb-no-const, r=BoxyUwU

Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes rust-lang#127970
Fixes rust-lang#127009

r? ``@BoxyUwU``
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 23, 2024
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-non_lifetime_binders `#![feature(non_lifetime_binders)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants