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: ConstContext::Maybe must have host effect param during mir_const_qualif #120503

Open
matthiaskrgr opened this issue Jan 30, 2024 · 3 comments
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. F-const_trait_impl `#![feature(const_trait_impl)]` F-effects `#![feature(effects)]` F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` I-cycle Issue: A query cycle occurred while none was expected I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-async Working group: Async & await

Comments

@matthiaskrgr
Copy link
Member

snippet:

#![feature(effects)]

trait MyTrait {}

impl MyTrait for i32 {
    async const fn bar(&self) {
        main8().await;
    }
}

Version information

rustc 1.77.0-nightly (5ad7454f7 2024-01-30)
binary: rustc
commit-hash: 5ad7454f7503b6af2800bf4a7c875962cb03f913
commit-date: 2024-01-30
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

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

Program output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: pass `--edition 2021` to `rustc`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error: expected one of `extern`, `fn`, or `unsafe`, found keyword `const`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:11
  |
6 |     async const fn bar(&self) {
  |     ------^^^^^
  |     |     |
  |     |     expected one of `extern`, `fn`, or `unsafe`
  |     help: `const` must come before `async`: `const async`
  |
  = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`

error[E0379]: functions in trait impls cannot be declared const
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:11
  |
6 |     async const fn bar(&self) {
  |           ^^^^^-
  |           |
  |           functions in trait impls cannot be const
  |           help: remove the `const`

error: functions cannot be both `const` and `async`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |       async const fn bar(&self) {
  |       -^^^^ ^^^^^ `const` because of this
  |       |
  |  _____`async` because of this
  | |
7 | |         main8().await;
8 | |     }
  | |_____-

error[E0407]: method `bar` is not a member of trait `MyTrait`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 | /     async const fn bar(&self) {
7 | |         main8().await;
8 | |     }
  | |_____^ not a member of trait `MyTrait`

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:9:2
  |
9 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs`

error[E0425]: cannot find function `main8` in this scope
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:7:9
  |
7 |         main8().await;
  |         ^^^^^ not found in this scope

thread 'rustc' panicked at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/compiler/rustc_middle/src/ty/util.rs:849:22:
ConstContext::Maybe must have host effect param
stack backtrace:
   0:     0x7fe94098bd16 - std::backtrace_rs::backtrace::libunwind::trace::h72011ad491b66ea7
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fe94098bd16 - std::backtrace_rs::backtrace::trace_unsynchronized::hfacfcb070c9bf6a6
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fe94098bd16 - std::sys_common::backtrace::_print_fmt::h64d60c4b8318f4c9
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fe94098bd16 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc0b55d074420c4c8
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fe9409de770 - core::fmt::rt::Argument::fmt::h44d828cd3f08e434
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/fmt/rt.rs:142:9
   5:     0x7fe9409de770 - core::fmt::write::h654173c004ce0000
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fe94097f58f - std::io::Write::write_fmt::h194317de3dd2a616
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/io/mod.rs:1846:15
   7:     0x7fe94098baf4 - std::sys_common::backtrace::_print::h85f84de9daadd08a
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fe94098baf4 - std::sys_common::backtrace::print::h39e3018c7025e846
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fe94098e887 - std::panicking::default_hook::{{closure}}::h11f92b8affe5382f
  10:     0x7fe94098e5e9 - std::panicking::default_hook::h900ee4bcbdf7c192
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/panicking.rs:292:9
  11:     0x7fe9437399ac - std[54f701ff8bed27ba]::panicking::update_hook::<alloc[a83636b43d09c3d5]::boxed::Box<rustc_driver_impl[992ec5f4edbde9dd]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fe94098efd6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h62f7a9d0498f9b9a
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/alloc/src/boxed.rs:2029:9
  13:     0x7fe94098efd6 - std::panicking::rust_panic_with_hook::h065109c06807d74c
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/panicking.rs:785:13
  14:     0x7fe94098ed22 - std::panicking::begin_panic_handler::{{closure}}::h457f22862e58d32b
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/panicking.rs:659:13
  15:     0x7fe94098c216 - std::sys_common::backtrace::__rust_end_short_backtrace::h987aced00b7d9afd
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7fe94098ea74 - rust_begin_unwind
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/panicking.rs:647:5
  17:     0x7fe9409dae75 - core::panicking::panic_fmt::h20b16f9144caec1a
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/panicking.rs:72:14
  18:     0x7fe9409dac23 - core::panicking::panic_display::h0773fce420d2dbf5
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/panicking.rs:196:5
  19:     0x7fe9409dac23 - core::panicking::panic_str::hedede5899ebcc889
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/panicking.rs:171:5
  20:     0x7fe9409dac23 - core::option::expect_failed::hee098f6d386fc871
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/core/src/option.rs:1988:5
  21:     0x7fe9455e2974 - <rustc_const_eval[ed0987334911aac2]::transform::check_consts::qualifs::NeedsNonConstDrop as rustc_const_eval[ed0987334911aac2]::transform::check_consts::qualifs::Qualif>::in_any_value_of_ty
  22:     0x7fe94370280e - rustc_const_eval[ed0987334911aac2]::transform::check_consts::qualifs::in_any_value_of_ty
  23:     0x7fe94506db0e - <rustc_const_eval[ed0987334911aac2]::transform::check_consts::check::Checker>::qualifs_in_return_place
  24:     0x7fe94506c4f3 - rustc_mir_transform[57db4c8326afd1a4]::mir_const_qualif
  25:     0x7fe94506c3af - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::mir_const_qualif::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 5usize]>>
  26:     0x7fe94506b688 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 5usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  27:     0x7fe94506b3f4 - rustc_query_impl[10ab52a21a26d451]::query_impl::mir_const_qualif::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fe94506b20f - rustc_middle[19997e6f7f752aa2]::query::plumbing::query_get_at::<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 5usize]>>>
  29:     0x7fe942c46081 - rustc_mir_transform[57db4c8326afd1a4]::mir_promoted
  30:     0x7fe944ebbc12 - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 16usize]>>
  31:     0x7fe944ebbedc - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::VecCache<rustc_span[f474d682e4803cf6]::def_id::LocalDefId, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  32:     0x7fe945806617 - rustc_query_impl[10ab52a21a26d451]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7fe94580672e - rustc_borrowck[475c3940e0bbd71e]::mir_borrowck
  34:     0x7fe94580665b - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>
  35:     0x7fe944d447f9 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::VecCache<rustc_span[f474d682e4803cf6]::def_id::LocalDefId, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  36:     0x7fe944d44250 - rustc_query_impl[10ab52a21a26d451]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7fe9459ce62d - rustc_hir_analysis[fd66094b79b5f3c7]::collect::type_of::type_of_opaque
  38:     0x7fe9459ce2a7 - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>
  39:     0x7fe944a72621 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  40:     0x7fe945a310de - rustc_query_impl[10ab52a21a26d451]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7fe944bdd84f - rustc_middle[19997e6f7f752aa2]::query::plumbing::query_get_at::<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>>
  42:     0x7fe942c8fad8 - rustc_hir_analysis[fd66094b79b5f3c7]::collect::type_of::type_of
  43:     0x7fe944a739aa - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>
  44:     0x7fe944a72621 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  45:     0x7fe944a721dd - rustc_query_impl[10ab52a21a26d451]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7fe944bdd84f - rustc_middle[19997e6f7f752aa2]::query::plumbing::query_get_at::<rustc_query_system[30b737ba6490e87b]::query::caches::DefIdCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 8usize]>>>
  47:     0x7fe94546677b - rustc_hir_analysis[fd66094b79b5f3c7]::check::wfcheck::check_well_formed
  48:     0x7fe945463b19 - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>
  49:     0x7fe9454631f1 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::VecCache<rustc_hir[43c3f5a0301c7221]::hir_id::OwnerId, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  50:     0x7fe945462f51 - rustc_query_impl[10ab52a21a26d451]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  51:     0x7fe945460d1c - rustc_hir_analysis[fd66094b79b5f3c7]::check::wfcheck::check_mod_type_wf
  52:     0x7fe945460c4d - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>
  53:     0x7fe94545ff3b - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::DefaultCache<rustc_span[f474d682e4803cf6]::def_id::LocalModDefId, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  54:     0x7fe94545fc43 - rustc_query_impl[10ab52a21a26d451]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  55:     0x7fe944d41d45 - rustc_middle[19997e6f7f752aa2]::query::plumbing::query_ensure_error_guaranteed::<rustc_query_system[30b737ba6490e87b]::query::caches::DefaultCache<rustc_span[f474d682e4803cf6]::def_id::LocalModDefId, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>, ()>
  56:     0x7fe944d42610 - rustc_hir_analysis[fd66094b79b5f3c7]::check_crate
  57:     0x7fe94532f412 - rustc_interface[1d601030f2bdc91b]::passes::analysis
  58:     0x7fe94532f05f - rustc_query_impl[10ab52a21a26d451]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[10ab52a21a26d451]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>
  59:     0x7fe945990640 - rustc_query_system[30b737ba6490e87b]::query::plumbing::try_execute_query::<rustc_query_impl[10ab52a21a26d451]::DynamicConfig<rustc_query_system[30b737ba6490e87b]::query::caches::SingleCache<rustc_middle[19997e6f7f752aa2]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[10ab52a21a26d451]::plumbing::QueryCtxt, false>
  60:     0x7fe9459903b9 - rustc_query_impl[10ab52a21a26d451]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  61:     0x7fe9457055f6 - rustc_interface[1d601030f2bdc91b]::interface::run_compiler::<core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>, rustc_driver_impl[992ec5f4edbde9dd]::run_compiler::{closure#0}>::{closure#0}
  62:     0x7fe9453aa2ca - std[54f701ff8bed27ba]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1d601030f2bdc91b]::util::run_in_thread_with_globals<rustc_interface[1d601030f2bdc91b]::util::run_in_thread_pool_with_globals<rustc_interface[1d601030f2bdc91b]::interface::run_compiler<core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>, rustc_driver_impl[992ec5f4edbde9dd]::run_compiler::{closure#0}>::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>
  63:     0x7fe9453aa0f9 - <<std[54f701ff8bed27ba]::thread::Builder>::spawn_unchecked_<rustc_interface[1d601030f2bdc91b]::util::run_in_thread_with_globals<rustc_interface[1d601030f2bdc91b]::util::run_in_thread_pool_with_globals<rustc_interface[1d601030f2bdc91b]::interface::run_compiler<core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>, rustc_driver_impl[992ec5f4edbde9dd]::run_compiler::{closure#0}>::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4c86ceb0893c3104]::result::Result<(), rustc_span[f474d682e4803cf6]::ErrorGuaranteed>>::{closure#1} as core[4c86ceb0893c3104]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  64:     0x7fe940998675 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3068c3095d2fc4ea
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/alloc/src/boxed.rs:2015:9
  65:     0x7fe940998675 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he2790d6b8e8cdd62
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/alloc/src/boxed.rs:2015:9
  66:     0x7fe940998675 - std::sys::pal::unix::thread::Thread::new::thread_start::ha0d1468f9dded566
                               at /rustc/5ad7454f7503b6af2800bf4a7c875962cb03f913/library/std/src/sys/pal/unix/thread.rs:108:17
  67:     0x7fe9407839eb - <unknown>
  68:     0x7fe9408077cc - <unknown>
  69:                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.77.0-nightly (5ad7454f7 2024-01-30) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_const_qualif] const checking `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`
#1 [mir_promoted] promoting constants in MIR for `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`
#2 [mir_borrowck] borrow-checking `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`
#3 [type_of_opaque] computing type of opaque `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}`
#4 [type_of] computing type of `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}`
#5 [check_well_formed] checking that `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}` is well-formed
#6 [check_mod_type_wf] checking that types are well-formed in top-level module
#7 [analysis] running analysis passes on this crate
end of query stack
error[E0391]: cycle detected when computing type of opaque `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: ...which requires borrow-checking `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`...
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires promoting constants in MIR for `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`...
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const checking `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar`...
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: ...which requires computing whether `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}` is freeze...
  = note: ...which requires evaluating trait selection obligation `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}: core::marker::Freeze`...
  = note: ...which again requires computing type of opaque `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}`, completing the cycle
note: cycle used when computing type of `<impl at /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:5:1: 5:21>::bar::{opaque#0}`
 --> /tmp/icemaker_global_tempdir.ZCOl2eTvAa4g/rustc_testrunner_tmpdir_reporting.XctsYzGJPJML/mvce.rs:6:5
  |
6 |     async const fn bar(&self) {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0379, E0391, E0407, E0425, E0601, E0670.
For more information about an error, try `rustc --explain E0379`.

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

This one seems different from #118320 as it gets beyond type checking but crashes in mir_const_qualif.
Bisects to Regression in nightly-2024-01-04
I suspect this crashes since #119505 cc @fmease 🤔

@fmease fmease added F-effects `#![feature(effects)]` I-cycle Issue: A query cycle occurred while none was expected A-async-await Area: Async & Await F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 30, 2024
@traviscross
Copy link
Contributor

@rustbot labels +AsyncAwait-Triaged +WG-async

We reviewed this today in WG-async triage. We agree this is a bug.

@rustbot rustbot added AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. WG-async Working group: Async & await labels Feb 26, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 15, 2024
@fmease fmease added the F-const_trait_impl `#![feature(const_trait_impl)]` label Nov 15, 2024
@fmease
Copy link
Member

fmease commented Nov 16, 2024

No longer reproduces. However, tests/crashes/120503.rs no longer exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. F-const_trait_impl `#![feature(const_trait_impl)]` F-effects `#![feature(effects)]` F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` I-cycle Issue: A query cycle occurred while none was expected I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-async Working group: Async & await
Projects
None yet
Development

No branches or pull requests

4 participants