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 region for note_and_explain_region: '?9 #124973

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

ICE: unexpected region for note_and_explain_region: '?9 #124973

matthiaskrgr opened this issue May 10, 2024 · 1 comment
Labels
A-async-await Area: Async & Await 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.

Comments

@matthiaskrgr
Copy link
Member

snippet:

async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}

Version information

rustc 1.80.0-nightly (cf774742b 2024-05-10)
binary: rustc
commit-hash: cf774742b6029e0c2e00654975c001d192063b5b
commit-date: 2024-05-10
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4

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

Program output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> /tmp/icemaker_global_tempdir.GiN1IAxQuFjn/rustc_testrunner_tmpdir_reporting.SqlRTUOo4WQV/mvce.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^ 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: only foreign or `unsafe extern "C"` functions may be C-variadic
 --> /tmp/icemaker_global_tempdir.GiN1IAxQuFjn/rustc_testrunner_tmpdir_reporting.SqlRTUOo4WQV/mvce.rs:1:50
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                  ^^^

error[E0658]: C-variadic functions are unstable
 --> /tmp/icemaker_global_tempdir.GiN1IAxQuFjn/rustc_testrunner_tmpdir_reporting.SqlRTUOo4WQV/mvce.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #44930 <https://github.com/rust-lang/rust/issues/44930> for more information
  = help: add `#![feature(c_variadic)]` to the crate attributes to enable
  = note: this compiler was built on 2024-05-10; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.GiN1IAxQuFjn/rustc_testrunner_tmpdir_reporting.SqlRTUOo4WQV/mvce.rs:1:57
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                         ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.GiN1IAxQuFjn/rustc_testrunner_tmpdir_reporting.SqlRTUOo4WQV/mvce.rs`

error: internal compiler error: compiler/rustc_infer/src/infer/error_reporting/mod.rs:176:13: unexpected region for note_and_explain_region: '?9

thread 'rustc' panicked at compiler/rustc_infer/src/infer/error_reporting/mod.rs:176:13:
Box<dyn Any>
stack backtrace:
   0:     0x72a768e58c45 - std::backtrace_rs::backtrace::libunwind::trace::h4459b5fcdbbebcd1
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x72a768e58c45 - std::backtrace_rs::backtrace::trace_unsynchronized::h7689b852d677b87d
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x72a768e58c45 - std::sys_common::backtrace::_print_fmt::h71c26c720eed4647
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x72a768e58c45 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdc35caba0025b2c4
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x72a768ea7deb - core::fmt::rt::Argument::fmt::h17121c67f3b92fbf
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/core/src/fmt/rt.rs:165:63
   5:     0x72a768ea7deb - core::fmt::write::hffa7869c496aec23
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/core/src/fmt/mod.rs:1157:21
   6:     0x72a768e4da0f - std::io::Write::write_fmt::hb780122e9345f028
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/io/mod.rs:1835:15
   7:     0x72a768e58a1e - std::sys_common::backtrace::_print::h33baa58fa7a6d4bc
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x72a768e58a1e - std::sys_common::backtrace::print::h3a8dfa067742d211
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x72a768e5b389 - std::panicking::default_hook::{{closure}}::h82b1676be98878d1
  10:     0x72a768e5b0cd - std::panicking::default_hook::h77201445fc6e0430
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/panicking.rs:298:9
  11:     0x72a7658bd43f - std[c6b2ad78a8ca1f10]::panicking::update_hook::<alloc[30e716310958d772]::boxed::Box<rustc_driver_impl[952cc77b60b888c7]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x72a768e5ba86 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h0dc40c62f822978e
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/alloc/src/boxed.rs:2036:9
  13:     0x72a768e5ba86 - std::panicking::rust_panic_with_hook::hbec4547bfff54ec7
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/panicking.rs:799:13
  14:     0x72a7658eca64 - std[c6b2ad78a8ca1f10]::panicking::begin_panic::<rustc_errors[96ae9b2e9b8e7aba]::ExplicitBug>::{closure#0}
  15:     0x72a7658e9886 - std[c6b2ad78a8ca1f10]::sys_common::backtrace::__rust_end_short_backtrace::<std[c6b2ad78a8ca1f10]::panicking::begin_panic<rustc_errors[96ae9b2e9b8e7aba]::ExplicitBug>::{closure#0}, !>
  16:     0x72a7658e9566 - std[c6b2ad78a8ca1f10]::panicking::begin_panic::<rustc_errors[96ae9b2e9b8e7aba]::ExplicitBug>
  17:     0x72a7658f5db1 - <rustc_errors[96ae9b2e9b8e7aba]::diagnostic::BugAbort as rustc_errors[96ae9b2e9b8e7aba]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x72a765dba14c - rustc_middle[593177a75effa888]::util::bug::opt_span_bug_fmt::<rustc_span[dba908c66bd5e7b9]::span_encoding::Span>::{closure#0}
  19:     0x72a765d9e08a - rustc_middle[593177a75effa888]::ty::context::tls::with_opt::<rustc_middle[593177a75effa888]::util::bug::opt_span_bug_fmt<rustc_span[dba908c66bd5e7b9]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x72a765d9df0b - rustc_middle[593177a75effa888]::ty::context::tls::with_context_opt::<rustc_middle[593177a75effa888]::ty::context::tls::with_opt<rustc_middle[593177a75effa888]::util::bug::opt_span_bug_fmt<rustc_span[dba908c66bd5e7b9]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x72a763b646c0 - rustc_middle[593177a75effa888]::util::bug::bug_fmt
  22:     0x72a765bc85c5 - rustc_infer[df220a3f8ba47496]::infer::error_reporting::note_and_explain_region
  23:     0x72a765bf6845 - rustc_infer[df220a3f8ba47496]::infer::error_reporting::unexpected_hidden_region_diagnostic
  24:     0x72a767b6694e - rustc_borrowck[4ef7d159813c8a4]::do_mir_borrowck
  25:     0x72a767b3403c - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>
  26:     0x72a766f9ce31 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::VecCache<rustc_span[dba908c66bd5e7b9]::def_id::LocalDefId, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  27:     0x72a766f9c88c - rustc_query_impl[476d1842c1ea56b3]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  28:     0x72a7675c3e2f - rustc_middle[593177a75effa888]::query::plumbing::query_get_at::<rustc_query_system[c7df0e1991f41dfe]::query::caches::VecCache<rustc_span[dba908c66bd5e7b9]::def_id::LocalDefId, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>>
  29:     0x72a76794d2dc - rustc_hir_analysis[e055a71f98e58cea]::collect::type_of::type_of_opaque
  30:     0x72a76794d14f - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>
  31:     0x72a766c6e097 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::DefIdCache<rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  32:     0x72a767c0b3de - rustc_query_impl[476d1842c1ea56b3]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  33:     0x72a767257ebc - rustc_middle[593177a75effa888]::query::plumbing::query_get_at::<rustc_query_system[c7df0e1991f41dfe]::query::caches::DefIdCache<rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>>
  34:     0x72a764a3f333 - rustc_hir_analysis[e055a71f98e58cea]::collect::type_of::type_of
  35:     0x72a766c6f46c - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>
  36:     0x72a766c6e097 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::DefIdCache<rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  37:     0x72a766c6db9b - rustc_query_impl[476d1842c1ea56b3]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  38:     0x72a767257ebc - rustc_middle[593177a75effa888]::query::plumbing::query_get_at::<rustc_query_system[c7df0e1991f41dfe]::query::caches::DefIdCache<rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 8usize]>>>
  39:     0x72a767ba6f5a - rustc_hir_analysis[e055a71f98e58cea]::check::check::check_item_type
  40:     0x72a7672425d5 - rustc_hir_analysis[e055a71f98e58cea]::check::wfcheck::check_well_formed
  41:     0x72a76724109d - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>
  42:     0x72a767240840 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::VecCache<rustc_hir[e7d04f52188a6143]::hir_id::OwnerId, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  43:     0x72a7672405bf - rustc_query_impl[476d1842c1ea56b3]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  44:     0x72a76723e4f7 - rustc_hir_analysis[e055a71f98e58cea]::check::wfcheck::check_mod_type_wf
  45:     0x72a76723e31f - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>
  46:     0x72a7676697b0 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::DefaultCache<rustc_span[dba908c66bd5e7b9]::def_id::LocalModDefId, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  47:     0x72a76766955b - rustc_query_impl[476d1842c1ea56b3]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  48:     0x72a766f99e86 - rustc_hir_analysis[e055a71f98e58cea]::check_crate
  49:     0x72a766f900c7 - rustc_interface[46c8bb9d4caee8c3]::passes::analysis
  50:     0x72a766f8fc15 - rustc_query_impl[476d1842c1ea56b3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[476d1842c1ea56b3]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>
  51:     0x72a7679c9125 - rustc_query_system[c7df0e1991f41dfe]::query::plumbing::try_execute_query::<rustc_query_impl[476d1842c1ea56b3]::DynamicConfig<rustc_query_system[c7df0e1991f41dfe]::query::caches::SingleCache<rustc_middle[593177a75effa888]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[476d1842c1ea56b3]::plumbing::QueryCtxt, false>
  52:     0x72a7679c8e89 - rustc_query_impl[476d1842c1ea56b3]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  53:     0x72a76783b98e - rustc_interface[46c8bb9d4caee8c3]::interface::run_compiler::<core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>, rustc_driver_impl[952cc77b60b888c7]::run_compiler::{closure#0}>::{closure#1}
  54:     0x72a7678006c9 - std[c6b2ad78a8ca1f10]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[46c8bb9d4caee8c3]::util::run_in_thread_with_globals<rustc_interface[46c8bb9d4caee8c3]::util::run_in_thread_pool_with_globals<rustc_interface[46c8bb9d4caee8c3]::interface::run_compiler<core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>, rustc_driver_impl[952cc77b60b888c7]::run_compiler::{closure#0}>::{closure#1}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>::{closure#0}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>
  55:     0x72a767800476 - <<std[c6b2ad78a8ca1f10]::thread::Builder>::spawn_unchecked_<rustc_interface[46c8bb9d4caee8c3]::util::run_in_thread_with_globals<rustc_interface[46c8bb9d4caee8c3]::util::run_in_thread_pool_with_globals<rustc_interface[46c8bb9d4caee8c3]::interface::run_compiler<core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>, rustc_driver_impl[952cc77b60b888c7]::run_compiler::{closure#0}>::{closure#1}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>::{closure#0}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[64db745a9a78ebe5]::result::Result<(), rustc_span[dba908c66bd5e7b9]::ErrorGuaranteed>>::{closure#2} as core[64db745a9a78ebe5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  56:     0x72a768e658cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h33c1d84a0e8e1d74
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/alloc/src/boxed.rs:2022:9
  57:     0x72a768e658cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hab68c4985632962b
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/alloc/src/boxed.rs:2022:9
  58:     0x72a768e658cb - std::sys::pal::unix::thread::Thread::new::thread_start::h8f78dbadd93ecd2e
                               at /rustc/cf774742b6029e0c2e00654975c001d192063b5b/library/std/src/sys/pal/unix/thread.rs:108:17
  59:     0x72a7626a955a - <unknown>
  60:     0x72a762726a3c - <unknown>
  61:                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: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (cf774742b 2024-05-10) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `multiple_named_lifetimes`
#1 [type_of_opaque] computing type of opaque `multiple_named_lifetimes::{opaque#0}`
#2 [type_of] computing type of `multiple_named_lifetimes::{opaque#0}`
#3 [check_well_formed] checking that `multiple_named_lifetimes::{opaque#0}` 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 5 previous errors

Some errors have detailed explanations: E0601, E0658, E0670.
For more information about an 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, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 10, 2024
@matthiaskrgr
Copy link
Member Author

#124918 cc @nnethercote

@saethlin saethlin added A-async-await Area: Async & Await and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 11, 2024
nnethercote added a commit to nnethercote/rust that referenced this issue May 12, 2024
PR rust-lang#124918 made this path abort. The added test, from fuzzing,
identified that it is reachable.
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 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.
Projects
None yet
Development

No branches or pull requests

3 participants