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

ConstContext::Maybe must have host effect param #125977

Closed
thomasyonug opened this issue Jun 4, 2024 · 1 comment
Closed

ConstContext::Maybe must have host effect param #125977

thomasyonug opened this issue Jun 4, 2024 · 1 comment
Labels
C-bug Category: This is a bug. F-const_closures `#![feature(const_closures)]` F-effects `#![feature(effects)]` 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

@thomasyonug
Copy link

Code

#![feature(const_closures, const_trait_impl, effects)]
#![allow(incomplete_features)]
pub const _: () = {
    assert!((const || 1 + 1 == 2)());
};
fn main() {}

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (debd22da6 2024-05-29)
binary: rustc
commit-hash: debd22da66cfa97c74040ebf68e420672ac8560e
commit-date: 2024-05-29
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Error output

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/ywz/Facro/rustc-ice-2024-06-04T13_01_51-1226204.txt` to your bug report                                                              
                                                                                                                                                                            
query stack during panic:                                                                                                                                                   
#0 [typeck] type-checking `_`                                                                                                                                               
#1 [check_well_formed] checking that `_` is well-formed 
Backtrace

thread 'rustc' panicked at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/compiler/rustc_middle/src/ty/util.rs:887:22:
ConstContext::Maybe must have host effect param
stack backtrace:
   0:     0x7f499d4cbdf5 - std::backtrace_rs::backtrace::libunwind::trace::h90edf881e325b8a6
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7f499d4cbdf5 - std::backtrace_rs::backtrace::trace_unsynchronized::h50a92732fba3c474
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f499d4cbdf5 - std::backtrace::Backtrace::create::he8f1866b659d60fe
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/backtrace.rs:331:13
   3:     0x7f499d4cbd45 - std::backtrace::Backtrace::force_capture::h0ae0a04b4f80a856
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/backtrace.rs:312:9
   4:     0x7f49a069ce26 - std[9d83bd0e50f0e1cd]::panicking::update_hook::<alloc[c6e8cd8d3db589af]::boxed::Box<rustc_driver_impl[c903d310d0b65222]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f499d4e6c0b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hc73dfd93ee0f7266
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/alloc/src/boxed.rs:2077:9
   6:     0x7f499d4e6c0b - std::panicking::rust_panic_with_hook::h2209cb47b146c46d
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/panicking.rs:799:13
   7:     0x7f499d4e6984 - std::panicking::begin_panic_handler::{{closure}}::he5e3fa707f3ea5de
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/panicking.rs:664:13
   8:     0x7f499d4e4189 - std::sys_common::backtrace::__rust_end_short_backtrace::ha2ea09ba2d1d8811
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7f499d4e66b7 - rust_begin_unwind
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/panicking.rs:652:5
  10:     0x7f499d530c53 - core::panicking::panic_fmt::h0c11f2b57d43e9cf
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/core/src/panicking.rs:72:14
  11:     0x7f499d5309fb - core::panicking::panic_display::h41cc9982c34f0a00
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/core/src/panicking.rs:262:5
  12:     0x7f499d5309fb - core::option::expect_failed::h0ed240b5a18e2c3c
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/core/src/option.rs:1997:5
  13:     0x7f49a2541e6a - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::write_method_call_and_enforce_effects
  14:     0x7f49a1ba08ea - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_overloaded_binop
  15:     0x7f49a2556edb - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  16:     0x7f49a1b9fb42 - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_overloaded_binop
  17:     0x7f49a2556edb - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18:     0x7f49a1f44756 - rustc_hir_typeck[46d0260dd4aa5284]::check::check_fn
  19:     0x7f49a2327efd - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_closure
  20:     0x7f49a25596ae - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:     0x7f49a25551f5 - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  22:     0x7f49a25582fd - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:     0x7f49a25575b1 - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24:     0x7f49a255707a - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:     0x7f49a2550db3 - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_block_with_expected
  26:     0x7f49a2555ee2 - <rustc_hir_typeck[46d0260dd4aa5284]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7f49a1f3b71b - rustc_hir_typeck[46d0260dd4aa5284]::typeck
  28:     0x7f49a1f39951 - rustc_query_impl[1766610d02d5b99c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1766610d02d5b99c]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 8usize]>>
  29:     0x7f49a1d19eae - rustc_query_system[b83bd47e643a06b7]::query::plumbing::try_execute_query::<rustc_query_impl[1766610d02d5b99c]::DynamicConfig<rustc_query_system[b83bd47e643a06b7]::query::caches::VecCache<rustc_span[dae7ad9294c1830]::def_id::LocalDefId, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1766610d02d5b99c]::plumbing::QueryCtxt, false>
  30:     0x7f49a1d189d5 - rustc_query_impl[1766610d02d5b99c]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7f49a2b8fb32 - rustc_hir_analysis[eda2ca149d9b7cb8]::check::check::check_item_type
  32:     0x7f49a23a5eff - rustc_hir_analysis[eda2ca149d9b7cb8]::check::wfcheck::check_well_formed
  33:     0x7f49a23a4791 - rustc_query_impl[1766610d02d5b99c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1766610d02d5b99c]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>
  34:     0x7f49a23a3f26 - rustc_query_system[b83bd47e643a06b7]::query::plumbing::try_execute_query::<rustc_query_impl[1766610d02d5b99c]::DynamicConfig<rustc_query_system[b83bd47e643a06b7]::query::caches::VecCache<rustc_hir[50cf4d107a5e43e6]::hir_id::OwnerId, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1766610d02d5b99c]::plumbing::QueryCtxt, false>
  35:     0x7f49a23a3ca4 - rustc_query_impl[1766610d02d5b99c]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f49a23a1b77 - rustc_hir_analysis[eda2ca149d9b7cb8]::check::wfcheck::check_mod_type_wf
  37:     0x7f49a23a19a1 - rustc_query_impl[1766610d02d5b99c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1766610d02d5b99c]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>
  38:     0x7f49a25c4230 - rustc_query_system[b83bd47e643a06b7]::query::plumbing::try_execute_query::<rustc_query_impl[1766610d02d5b99c]::DynamicConfig<rustc_query_system[b83bd47e643a06b7]::query::caches::DefaultCache<rustc_span[dae7ad9294c1830]::def_id::LocalModDefId, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1766610d02d5b99c]::plumbing::QueryCtxt, false>
  39:     0x7f49a25c3fd9 - rustc_query_impl[1766610d02d5b99c]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f49a1d16ad0 - rustc_hir_analysis[eda2ca149d9b7cb8]::check_crate
  41:     0x7f49a24e64be - rustc_interface[ae16de42642863e5]::passes::analysis
  42:     0x7f49a24e601b - rustc_query_impl[1766610d02d5b99c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1766610d02d5b99c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>
  43:     0x7f49a28e3725 - rustc_query_system[b83bd47e643a06b7]::query::plumbing::try_execute_query::<rustc_query_impl[1766610d02d5b99c]::DynamicConfig<rustc_query_system[b83bd47e643a06b7]::query::caches::SingleCache<rustc_middle[1fe6d5e38895052f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1766610d02d5b99c]::plumbing::QueryCtxt, false>
  44:     0x7f49a28e348f - rustc_query_impl[1766610d02d5b99c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  45:     0x7f49a2754cdc - rustc_interface[ae16de42642863e5]::interface::run_compiler::<core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>, rustc_driver_impl[c903d310d0b65222]::run_compiler::{closure#0}>::{closure#1}
  46:     0x7f49a27374c9 - std[9d83bd0e50f0e1cd]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ae16de42642863e5]::util::run_in_thread_with_globals<rustc_interface[ae16de42642863e5]::util::run_in_thread_pool_with_globals<rustc_interface[ae16de42642863e5]::interface::run_compiler<core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>, rustc_driver_impl[c903d310d0b65222]::run_compiler::{closure#0}>::{closure#1}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>::{closure#0}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>
  47:     0x7f49a2737272 - <<std[9d83bd0e50f0e1cd]::thread::Builder>::spawn_unchecked_<rustc_interface[ae16de42642863e5]::util::run_in_thread_with_globals<rustc_interface[ae16de42642863e5]::util::run_in_thread_pool_with_globals<rustc_interface[ae16de42642863e5]::interface::run_compiler<core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>, rustc_driver_impl[c903d310d0b65222]::run_compiler::{closure#0}>::{closure#1}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>::{closure#0}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2eaa0139eedd536f]::result::Result<(), rustc_span[dae7ad9294c1830]::ErrorGuaranteed>>::{closure#2} as core[2eaa0139eedd536f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  48:     0x7f499d4f0bfb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd6f696d9a5b925df
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/alloc/src/boxed.rs:2063:9
  49:     0x7f499d4f0bfb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h94ad61c1e5c5a0cd
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/alloc/src/boxed.rs:2063:9
  50:     0x7f499d4f0bfb - std::sys::pal::unix::thread::Thread::new::thread_start::h1856dc47c9451b83
                               at /rustc/debd22da66cfa97c74040ebf68e420672ac8560e/library/std/src/sys/pal/unix/thread.rs:108:17
  51:     0x7f499d3ea609 - start_thread
                               at /build/glibc-LcI20x/glibc-2.31/nptl/pthread_create.c:477:8
  52:     0x7f499d30d353 - clone
                               at /build/glibc-LcI20x/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  53:                0x0 - <unknown>


rustc version: 1.80.0-nightly (debd22da6 2024-05-29)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `_`
#1 [check_well_formed] checking that `_` is well-formed
#2 [check_mod_type_wf] checking that types are well-formed in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack

@thomasyonug thomasyonug 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 Jun 4, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 4, 2024
@fmease
Copy link
Member

fmease commented Jun 4, 2024

Closing as duplicate of #118320.

@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
@fmease fmease added F-effects `#![feature(effects)]` F-const_closures `#![feature(const_closures)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 4, 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-const_closures `#![feature(const_closures)]` F-effects `#![feature(effects)]` 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

3 participants