error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.E6qQXQsBxYEp/rustc_testrunner_tmpdir_reporting.HAMVYJjzmNyD/mvce.rs:9:2
|
9 | }
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.E6qQXQsBxYEp/rustc_testrunner_tmpdir_reporting.HAMVYJjzmNyD/mvce.rs`
thread 'rustc' (1135290) panicked at /rustc-dev/345a975e76de74f090c55d5b56f5f6dd41b655a2/compiler/rustc_hir_typeck/src/coercion.rs:2013:59:
RefCell already mutably borrowed
stack backtrace:
0: 0x7f9f302fae99 - <<std[a9eb3f39b69ad3ff]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[b04a2f1476229c25]::fmt::Display>::fmt
1: 0x7f9f30a15e48 - core[b04a2f1476229c25]::fmt::write
2: 0x7f9f30311986 - <std[a9eb3f39b69ad3ff]::sys::stdio::unix::Stderr as std[a9eb3f39b69ad3ff]::io::Write>::write_fmt
3: 0x7f9f302d109e - std[a9eb3f39b69ad3ff]::panicking::default_hook::{closure#0}
4: 0x7f9f302ee583 - std[a9eb3f39b69ad3ff]::panicking::default_hook
5: 0x7f9f2f2d9a71 - std[a9eb3f39b69ad3ff]::panicking::update_hook::<alloc[f5407cb677668734]::boxed::Box<rustc_driver_impl[4eedd31b7089c8cf]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f9f302ee862 - std[a9eb3f39b69ad3ff]::panicking::panic_with_hook
7: 0x7f9f302d1162 - std[a9eb3f39b69ad3ff]::panicking::panic_handler::{closure#0}
8: 0x7f9f302c5659 - std[a9eb3f39b69ad3ff]::sys::backtrace::__rust_end_short_backtrace::<std[a9eb3f39b69ad3ff]::panicking::panic_handler::{closure#0}, !>
9: 0x7f9f302d2bcd - __rustc[929c9a63fff72118]::rust_begin_unwind
10: 0x7f9f2cf183cc - core[b04a2f1476229c25]::panicking::panic_fmt
11: 0x7f9f2eb2766f - core[b04a2f1476229c25]::cell::panic_already_mutably_borrowed
12: 0x7f9f2ea8043f - <rustc_hir_typeck[4f770d89427b513d]::coercion::CoerceMany>::report_return_mismatched_types
13: 0x7f9f30e84a6b - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_return
14: 0x7f9f30e91d9a - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
15: 0x7f9f30e9bf05 - rustc_hir_typeck[4f770d89427b513d]::check::check_fn
16: 0x7f9f317b421c - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_closure
17: 0x7f9f30e92144 - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
18: 0x7f9f30e6c0f8 - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_call
19: 0x7f9f30e8fe41 - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
20: 0x7f9f30ea5932 - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_block
21: 0x7f9f30e9086f - <rustc_hir_typeck[4f770d89427b513d]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
22: 0x7f9f30e9bf05 - rustc_hir_typeck[4f770d89427b513d]::check::check_fn
23: 0x7f9f3139a506 - rustc_hir_typeck[4f770d89427b513d]::typeck_with_inspect::{closure#0}
24: 0x7f9f31397404 - rustc_query_impl[2be19ef8da6108aa]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
25: 0x7f9f30b18166 - rustc_query_impl[2be19ef8da6108aa]::execution::try_execute_query::<rustc_data_structures[fb6e4346a2abdb30]::vec_cache::VecCache<rustc_span[bbe1d656f07b00ee]::def_id::LocalDefId, rustc_middle[dbb0bf4bafb0ab2f]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[dbb0bf4bafb0ab2f]::dep_graph::graph::DepNodeIndex>, false>
26: 0x7f9f30b17a43 - rustc_query_impl[2be19ef8da6108aa]::query_impl::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
27: 0x7f9f312a8a54 - <rustc_middle[dbb0bf4bafb0ab2f]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[54c6f91f6d421f22]::check_crate::{closure#1}>::{closure#0}
28: 0x7f9f312a8426 - rustc_hir_analysis[54c6f91f6d421f22]::check_crate
29: 0x7f9f31943821 - rustc_interface[fb0ae15303da83fc]::passes::analysis
30: 0x7f9f31b7e7c9 - rustc_query_impl[2be19ef8da6108aa]::execution::try_execute_query::<rustc_middle[dbb0bf4bafb0ab2f]::query::caches::SingleCache<rustc_middle[dbb0bf4bafb0ab2f]::query::erase::ErasedData<[u8; 0usize]>>, false>
31: 0x7f9f31b7e429 - rustc_query_impl[2be19ef8da6108aa]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
32: 0x7f9f31b9b742 - rustc_interface[fb0ae15303da83fc]::interface::run_compiler::<(), rustc_driver_impl[4eedd31b7089c8cf]::run_compiler::{closure#0}>::{closure#1}
33: 0x7f9f31b731fe - std[a9eb3f39b69ad3ff]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[fb0ae15303da83fc]::util::run_in_thread_with_globals<rustc_interface[fb0ae15303da83fc]::util::run_in_thread_pool_with_globals<rustc_interface[fb0ae15303da83fc]::interface::run_compiler<(), rustc_driver_impl[4eedd31b7089c8cf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
34: 0x7f9f31b738ed - <std[a9eb3f39b69ad3ff]::thread::lifecycle::spawn_unchecked<rustc_interface[fb0ae15303da83fc]::util::run_in_thread_with_globals<rustc_interface[fb0ae15303da83fc]::util::run_in_thread_pool_with_globals<rustc_interface[fb0ae15303da83fc]::interface::run_compiler<(), rustc_driver_impl[4eedd31b7089c8cf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[b04a2f1476229c25]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
35: 0x7f9f31b7472c - <std[a9eb3f39b69ad3ff]::sys::thread::unix::Thread>::new::thread_start
36: 0x7f9f2b6a597a - <unknown>
37: 0x7f9f2b7292bc - <unknown>
38: 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: please make sure that you have updated to the latest nightly
note: rustc 1.97.0-nightly (345a975e7 2026-04-27) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [typeck_root] type-checking `test_func`
#1 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0601`.
auto-reduced (treereduce-rust):
original:
Version information
Possibly related line of code:
rust/compiler/rustc_hir_typeck/src/coercion.rs
Lines 2007 to 2019 in 345a975
Command:
/home/matthias/.rustup/toolchains/master/bin/rustcProgram output