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: unexpected bound var resolution #109096

Closed
matthiaskrgr opened this issue Mar 13, 2023 · 1 comment
Closed

ICE: unexpected bound var resolution #109096

matthiaskrgr opened this issue Mar 13, 2023 · 1 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.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(non_lifetime_binders)]
#![crate_type = "lib"]
fn a() where for<const C: usize> [(); C]: Copy {}

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (7b4f48927 2023-03-12)
binary: rustc
commit-hash: 7b4f48927dce585f747a58083b45ab62b9d73a53
commit-date: 2023-03-12
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> 369F0080915517E17111EE245F5EA4DFDB20ACBA83676D6A364219263BA449A5.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

error: cannot capture late-bound const parameter in a constant
 --> 369F0080915517E17111EE245F5EA4DFDB20ACBA83676D6A364219263BA449A5.rs:4:39
  |
4 | fn a() where for<const C: usize> [(); C]: Copy {}
  |                  --------------       ^
  |                  |
  |                  parameter defined here
Backtrace

error: internal compiler error: compiler/rustc_middle/src/ty/consts.rs:158:28: unexpected bound var resolution for HirId(DefId(0:3 ~ 369F0080915517E17111EE245F5EA4DFDB20ACBA83676D6A364219263BA449A5[c773]::a).9): None

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7fa1fd75251a - std::backtrace_rs::backtrace::libunwind::trace::hf7d75cca16fd1b61
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fa1fd75251a - std::backtrace_rs::backtrace::trace_unsynchronized::hf5ec95734aab509d
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fa1fd75251a - std::sys_common::backtrace::_print_fmt::he95113413355c8cd
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fa1fd75251a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h072d12f2e69ca92b
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fa1fd7b5c5e - core::fmt::write::h1d23f16415e96af2
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/core/src/fmt/mod.rs:1232:17
   5:     0x7fa1fd745275 - std::io::Write::write_fmt::hcf1e413fde4ffcd5
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/io/mod.rs:1684:15
   6:     0x7fa1fd7522e5 - std::sys_common::backtrace::_print::h6b2b14bedd5177e7
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fa1fd7522e5 - std::sys_common::backtrace::print::h09ccebfbcd382e89
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fa1fd75505f - std::panicking::default_hook::{{closure}}::h4ee055db778febc2
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:271:22
   9:     0x7fa1fd754d9b - std::panicking::default_hook::ha74f60e3a15d95fb
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:290:9
  10:     0x7fa1fc497085 - rustc_driver_impl[d355a67661263e47]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fa1fd75589d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7f34603beb945e8f
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:2002:9
  12:     0x7fa1fd75589d - std::panicking::rust_panic_with_hook::h4b5d379936d4932f
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:696:13
  13:     0x7fa1fca02371 - std[e52d7c968ed01318]::panicking::begin_panic::<rustc_errors[45159b7f7e36021d]::ExplicitBug>::{closure#0}
  14:     0x7fa1fc9fdaa6 - std[e52d7c968ed01318]::sys_common::backtrace::__rust_end_short_backtrace::<std[e52d7c968ed01318]::panicking::begin_panic<rustc_errors[45159b7f7e36021d]::ExplicitBug>::{closure#0}, !>
  15:     0x7fa1fca86046 - std[e52d7c968ed01318]::panicking::begin_panic::<rustc_errors[45159b7f7e36021d]::ExplicitBug>
  16:     0x7fa1fca51e06 - std[e52d7c968ed01318]::panic::panic_any::<rustc_errors[45159b7f7e36021d]::ExplicitBug>
  17:     0x7fa1fca4d966 - <rustc_errors[45159b7f7e36021d]::HandlerInner>::bug::<&alloc[fc860cae0dfa1ab1]::string::String>
  18:     0x7fa1fca4d630 - <rustc_errors[45159b7f7e36021d]::Handler>::bug::<&alloc[fc860cae0dfa1ab1]::string::String>
  19:     0x7fa1fca39a9b - rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt::<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}
  20:     0x7fa1fca384fa - rustc_middle[a96ac5d591578447]::ty::context::tls::with_opt::<rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fa1fca384c6 - rustc_middle[a96ac5d591578447]::ty::context::tls::with_context_opt::<rustc_middle[a96ac5d591578447]::ty::context::tls::with_opt<rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fa1fca399e6 - rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt::<rustc_span[f8bdfaef83e46314]::span_encoding::Span>
  23:     0x7fa1faab44b3 - rustc_middle[a96ac5d591578447]::util::bug::bug_fmt
  24:     0x7fa1fb687d9b - <rustc_middle[a96ac5d591578447]::ty::consts::Const>::from_opt_const_arg_anon_const
  25:     0x7fa1fb2f7c3f - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  26:     0x7fa1faa3d3d5 - rustc_hir_analysis[357075c2c3fc2a7b]::collect::predicates_of::gather_explicit_predicates_of
  27:     0x7fa1faa3b1d8 - rustc_hir_analysis[357075c2c3fc2a7b]::collect::predicates_of::explicit_predicates_of
  28:     0x7fa1faa36e54 - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::explicit_predicates_of, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  29:     0x7fa1faa4df73 - rustc_hir_analysis[357075c2c3fc2a7b]::collect::predicates_defined_on
  30:     0x7fa1faa4c596 - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::predicates_defined_on, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  31:     0x7fa1fb0358b5 - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::predicates_of, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  32:     0x7fa1fb03455f - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::predicates_of
  33:     0x7fa1fac7be02 - <rustc_hir_analysis[357075c2c3fc2a7b]::collect::CollectItemTypesVisitor as rustc_hir[4aa57babd8685147]::intravisit::Visitor>::visit_item
  34:     0x7fa1fac7a925 - <rustc_middle[a96ac5d591578447]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[357075c2c3fc2a7b]::collect::CollectItemTypesVisitor>
  35:     0x7fa1fac7a84c - rustc_hir_analysis[357075c2c3fc2a7b]::collect::collect_mod_item_types
  36:     0x7fa1fbac706e - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::collect_mod_item_types, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  37:     0x7fa1fbac6bf3 - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::collect_mod_item_types
  38:     0x7fa1fa7b0363 - <rustc_session[7e23441c2db8ce4a]::session::Session>::track_errors::<rustc_hir_analysis[357075c2c3fc2a7b]::check_crate::{closure#0}, ()>
  39:     0x7fa1fa7acce2 - rustc_hir_analysis[357075c2c3fc2a7b]::check_crate
  40:     0x7fa1fa7a2d12 - rustc_interface[6bf42eb308c32713]::passes::analysis
  41:     0x7fa1fbcab71c - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::analysis, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  42:     0x7fa1fbcab410 - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::analysis
  43:     0x7fa1fbad02f9 - <rustc_middle[a96ac5d591578447]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>
  44:     0x7fa1fb6c8498 - rustc_span[f8bdfaef83e46314]::with_source_map::<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  45:     0x7fa1fb6bf70c - std[e52d7c968ed01318]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6bf42eb308c32713]::util::run_in_thread_pool_with_globals<rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>
  46:     0x7fa1fb6bf13a - <<std[e52d7c968ed01318]::thread::Builder>::spawn_unchecked_<rustc_interface[6bf42eb308c32713]::util::run_in_thread_pool_with_globals<rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#1} as core[125d846441ac421f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7fa1fd75f793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc0a50816e1eb2bba
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:1988:9
  48:     0x7fa1fd75f793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2f83fc2049033c3
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:1988:9
  49:     0x7fa1fd75f793 - std::sys::unix::thread::Thread::new::thread_start::hce5861512f8bf7ea
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7fa1f909ebb5 - <unknown>
  51:     0x7fa1f9120d90 - <unknown>
  52:                0x0 - <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 (7b4f48927 2023-03-12) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `a`
#1 [predicates_defined_on] computing predicates of `a`
#2 [predicates_of] computing predicates of `a`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors; 1 warning emitted

@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. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` labels Mar 13, 2023
@compiler-errors
Copy link
Member

This is the same test as #108194, the ICE just changed in the last 3 weeks.

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

No branches or pull requests

2 participants