rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.9k stars 12.78k forks source link

ICE: `missing binding mode` #132142

Open matthiaskrgr opened 1 month ago

matthiaskrgr commented 1 month ago

auto-reduced (treereduce-rust):

async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes<T: Unpin>(_: u8, ...) {}

original:

#![feature("{}" a)]

async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes<T: Unpin>(_: u8, ...) { while main { } }
//~^ ERROR hidden type for `impl Future<Output = ()>` captures lifetime that does not appear in bounds

fn my_fn(_args: &[A]) {
  println!("hello world");
}

Version information

rustc 1.84.0-nightly (97ae1df8a 2024-10-25)
binary: rustc
commit-hash: 97ae1df8aa9fa6dfd29dced18b232d25208c4111
commit-date: 2024-10-25
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1

Possibly related line of code: https://github.com/rust-lang/rust/blob/97ae1df8aa9fa6dfd29dced18b232d25208c4111/compiler/rustc_hir_typeck/src/upvar.rs#L1785-L1797

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

Program output

``` error[E0670]: `async fn` is not permitted in Rust 2015 --> /tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs:1:1 | 1 | async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes(_: 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, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> /tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs:1:91 | 1 | async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes(_: u8, ...) {} | ^^^ error[E0658]: C-cmse-nonsecure-entry ABI is experimental and subject to change --> /tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs:1:21 | 1 | async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes(_: u8, ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #75835 for more information = help: add `#![feature(cmse_nonsecure_entry)]` to the crate attributes to enable = note: this compiler was built on 2024-10-25; consider upgrading it if it is out of date error[E0658]: C-variadic functions are unstable --> /tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs:1:1 | 1 | async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes(_: u8, ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #44930 for more information = help: add `#![feature(c_variadic)]` to the crate attributes to enable = note: this compiler was built on 2024-10-25; consider upgrading it if it is out of date error[E0601]: `main` function not found in crate `mvce` --> /tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs:1:98 | 1 | async unsafe extern "C-cmse-nonsecure-entry" fn multiple_named_lifetimes(_: u8, ...) {} | ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.4Ax9UanUShFv/rustc_testrunner_tmpdir_reporting.IEMd1DzRNcyR/mvce.rs` thread 'rustc' panicked at compiler/rustc_hir_typeck/src/upvar.rs:1791:70: missing binding mode stack backtrace: 0: 0x77075a09d83a - ::fmt::hcedb2fcda5cdd07c 1: 0x77075a8041ca - core::fmt::write::haa85bbf9373b67e8 2: 0x77075baa39d1 - std::io::Write::write_fmt::hd17b6cdad4d5e705 3: 0x77075a09d692 - std::sys::backtrace::BacktraceLock::print::h50f59795d6a1f7e3 4: 0x77075a09fb96 - std::panicking::default_hook::{{closure}}::h0966ca81a9d29c3a 5: 0x77075a09f9e0 - std::panicking::default_hook::h534e5141a1b02198 6: 0x770759119f9f - std[a151dedc4facde64]::panicking::update_hook::>::{closure#0} 7: 0x77075a0a02a8 - std::panicking::rust_panic_with_hook::h0090c4c2e6e5d265 8: 0x77075a0a007a - std::panicking::begin_panic_handler::{{closure}}::h5174eb866483fbac 9: 0x77075a09dce9 - std::sys::backtrace::__rust_end_short_backtrace::h334590b8864eb5e5 10: 0x77075a09fd3c - rust_begin_unwind 11: 0x770756ae3320 - core::panicking::panic_fmt::h307156d14c26e2e0 12: 0x77075713fbab - core::option::expect_failed::heb168b2a112ea99d 13: 0x77075c174c06 - ::determine_capture_mutability.cold 14: 0x77075b2352d0 - ::compute_min_captures 15: 0x770757910477 - ::analyze_closure 16: 0x7707575d564a - ::visit_expr 17: 0x77075aaea4a5 - rustc_hir_typeck[a8c3eaf7852a1958]::typeck 18: 0x77075aae9ac7 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 19: 0x77075ac43201 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 20: 0x77075ac41857 - rustc_query_impl[6ffb465cf6366f2]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace 21: 0x77075b178e0a - rustc_middle[58c8be1544d4ff96]::query::plumbing::query_get_at::>> 22: 0x77075b8ddbab - rustc_hir_analysis[f8c34c1d50f2c7d9]::collect::type_of::type_of_opaque 23: 0x77075b8ddae5 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 24: 0x77075ab854fa - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 25: 0x77075b996ff6 - rustc_query_impl[6ffb465cf6366f2]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace 26: 0x77075adef540 - rustc_middle[58c8be1544d4ff96]::query::plumbing::query_get_at::>> 27: 0x770757c2c334 - rustc_hir_analysis[f8c34c1d50f2c7d9]::collect::type_of::type_of 28: 0x77075ab868aa - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 29: 0x77075ab854fa - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 30: 0x77075ab850a3 - rustc_query_impl[6ffb465cf6366f2]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace 31: 0x77075b1296d0 - rustc_middle[58c8be1544d4ff96]::query::plumbing::query_get_at::>> 32: 0x77075aea761d - >::try_fold_ty 33: 0x77075aea2ac8 - )>>::call_once 34: 0x77075aea26f7 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 35: 0x77075aea1e19 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::, rustc_middle[58c8be1544d4ff96]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 36: 0x77075aea1b60 - rustc_query_impl[6ffb465cf6366f2]::query_impl::try_normalize_generic_arg_after_erasing_regions::get_query_non_incr::__rust_end_short_backtrace 37: 0x77075ae9dc8b - >::try_fold_ty 38: 0x77075afc8388 - rustc_ty_utils[3110184492a391f3]::layout::layout_of 39: 0x77075afc7f19 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 40: 0x77075afc71c8 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::, rustc_middle[58c8be1544d4ff96]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 41: 0x77075afc6e6d - rustc_query_impl[6ffb465cf6366f2]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace 42: 0x77075b8e66b2 - rustc_middle[58c8be1544d4ff96]::query::plumbing::query_get_at::, rustc_middle[58c8be1544d4ff96]::query::erase::Erased<[u8; 16usize]>>> 43: 0x7707592f168c - rustc_hir_analysis[f8c34c1d50f2c7d9]::hir_ty_lowering::cmse::is_valid_cmse_output 44: 0x77075b171ce6 - ::lower_fn_ty 45: 0x77075b16ffe4 - rustc_hir_analysis[f8c34c1d50f2c7d9]::collect::infer_return_ty_for_fn_sig 46: 0x77075b172555 - rustc_hir_analysis[f8c34c1d50f2c7d9]::collect::fn_sig 47: 0x77075aa5be6b - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 48: 0x77075aa5f064 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 49: 0x77075aa5e8e2 - rustc_query_impl[6ffb465cf6366f2]::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace 50: 0x77075ab7adbe - ::visit_item 51: 0x7707577bc428 - rustc_hir_analysis[f8c34c1d50f2c7d9]::check::wfcheck::check_well_formed 52: 0x77075ac04197 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 53: 0x77075ac038e7 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 54: 0x77075ac03550 - rustc_query_impl[6ffb465cf6366f2]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace 55: 0x77075ac04410 - rustc_hir_analysis[f8c34c1d50f2c7d9]::check::wfcheck::check_mod_type_wf 56: 0x77075ac04247 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 57: 0x77075b3d5745 - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 58: 0x77075b3d54f3 - rustc_query_impl[6ffb465cf6366f2]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace 59: 0x77075ac3effb - rustc_hir_analysis[f8c34c1d50f2c7d9]::check_crate 60: 0x77075ac33517 - rustc_interface[2b41161da54db00e]::passes::run_required_analyses 61: 0x77075b54925e - rustc_interface[2b41161da54db00e]::passes::analysis 62: 0x77075b549231 - rustc_query_impl[6ffb465cf6366f2]::plumbing::__rust_begin_short_backtrace::> 63: 0x77075b73816e - rustc_query_system[e2e7e315caf8fc79]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[6ffb465cf6366f2]::plumbing::QueryCtxt, false> 64: 0x77075b737e4f - rustc_query_impl[6ffb465cf6366f2]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace 65: 0x77075b6045b1 - rustc_interface[2b41161da54db00e]::interface::run_compiler::, rustc_driver_impl[bf30803df350f481]::run_compiler::{closure#0}>::{closure#1} 66: 0x77075b6a3454 - std[a151dedc4facde64]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[bf30803df350f481]::run_compiler::{closure#0}>::{closure#1}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>>::{closure#0}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>> 67: 0x77075b6a388d - <::spawn_unchecked_, rustc_driver_impl[bf30803df350f481]::run_compiler::{closure#0}>::{closure#1}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>>::{closure#0}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[301db181db02ff04]::result::Result<(), rustc_span[916daa99866cf1f4]::ErrorGuaranteed>>::{closure#1} as core[301db181db02ff04]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 68: 0x77075b6a432b - std::sys::pal::unix::thread::Thread::new::thread_start::h254586afceceda1d 69: 0x7707558a339d - 70: 0x77075592849c - 71: 0x0 - 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: rustc 1.84.0-nightly (97ae1df8a 2024-10-25) running on x86_64-unknown-linux-gnu query stack during panic: #0 [typeck] type-checking `multiple_named_lifetimes` #1 [type_of_opaque] computing type of opaque `multiple_named_lifetimes::{opaque#0}` 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`. ```

rustbot commented 1 month ago

Error: Parsing relabel command in comment failed: ...' label +F-' | error: quote in word at >| '"{}" a '...

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

matthiaskrgr commented 1 month ago

mvce:

async extern "C-cmse-nonsecure-entry" fn fun(...) {}
matthiaskrgr commented 1 month ago

bisects to #130747