Reading issue
rust-lang / rust · Issue No. 160589
auto-reduced (treereduce-rust):
fn main() {
if None::<str>() {}
}
original:
fn main() {
if None::<str>() {}
}
Version information
rustc 1.99.0-nightly (87212cef7 2026-08-05)
binary: rustc
commit-hash: 87212cef77e7bfa92ba0c4850be1d089745ba6fc
commit-date: 2026-08-05
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 23.1.0
Possibly related line of code:
https://github.com/rust-lang/rust/blob/87212cef77e7bfa92ba0c4850be1d089745ba6fc/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs#L224-L236
Command:/home/matthias/.rustup/toolchains/master/bin/rustc
error[E0618]: expected function, found enum variant `None<str>`
--> /tmp/icemaker_global_tempdir.zwqcIgjvUqIE/rustc_testrunner_tmpdir_reporting.xJ97gJejYS8G/mvce.rs:2:8
|
2 | if None::<str>() {}
| ^^^^^^^^^^^--
| |
| call expression requires function
|
help: `None<str>` is a unit enum variant, and does not take parentheses to be constructed
|
2 - if None::<str>() {}
2 + if None::<str> {}
|
thread 'rustc' (1771207) panicked at /rustc-dev/87212cef77e7bfa92ba0c4850be1d089745ba6fc/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:230:1:
DefId(2:53128 ~ core[e730]::option::Option::None::{constructor#0}) does not have a "fn_sig"
stack backtrace:
0: 0x7f2935f49af6 - <<std[76c4f663cfdf9de9]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[e73040c94e2c05fb]::fmt::Display>::fmt
1: 0x7f293660a40f - core[e73040c94e2c05fb]::fmt::write
2: 0x7f2935f5ea1c - <std[76c4f663cfdf9de9]::sys::stdio::unix::Stderr as core[e73040c94e2c05fb]::io::write::Write>::write_fmt
3: 0x7f2935f1c8da - std[76c4f663cfdf9de9]::panicking::default_hook::{closure#0}
4: 0x7f2935f3d673 - std[76c4f663cfdf9de9]::panicking::default_hook
5: 0x7f2934e8101a - std[76c4f663cfdf9de9]::panicking::update_hook::<alloc[6c3988ddb1173fa]::boxed::Box<rustc_driver_impl[babd6b97ed827c3b]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f2935f3db12 - std[76c4f663cfdf9de9]::panicking::panic_with_hook
7: 0x7f2935f1c992 - std[76c4f663cfdf9de9]::panicking::panic_handler::{closure#0}
8: 0x7f2935f14609 - std[76c4f663cfdf9de9]::sys::backtrace::__rust_end_short_backtrace::<std[76c4f663cfdf9de9]::panicking::panic_handler::{closure#0}, !>
9: 0x7f2935f1e36d - __rustc[597bf519f21c5b2a]::rust_begin_unwind
10: 0x7f2932b0cf2c - core[e73040c94e2c05fb]::panicking::panic_fmt
11: 0x7f29353f8971 - rustc_metadata[983eb2c9ed2f2131]::rmeta::decoder::cstore_impl::provide_extern::fn_sig::{closure#1}
12: 0x7f2936a211ac - rustc_metadata[983eb2c9ed2f2131]::rmeta::decoder::cstore_impl::provide_extern::fn_sig
13: 0x7f2936e0030b - rustc_query_impl[13b9a2342661e590]::query_impl::fn_sig::invoke_provider_fn::__rust_begin_short_backtrace
14: 0x7f2936e01c52 - rustc_query_impl[13b9a2342661e590]::execution::try_execute_query::<rustc_middle[398bfe4e000b8183]::query::caches::DefIdCache<rustc_middle[398bfe4e000b8183]::query::erase::ErasedData<[u8; 24usize]>>, false>
15: 0x7f2936e0179e - rustc_query_impl[13b9a2342661e590]::query_impl::fn_sig::execute_query_non_incr::__rust_end_short_backtrace
16: 0x7f2935d9e2e1 - <rustc_trait_selection[80cf404ec0a5bee9]::error_reporting::TypeErrCtxt>::suggest_add_reference_to_arg
17: 0x7f2935d4c31c - <rustc_trait_selection[80cf404ec0a5bee9]::error_reporting::TypeErrCtxt>::report_selection_error
18: 0x7f2935d70e5f - <rustc_trait_selection[80cf404ec0a5bee9]::error_reporting::TypeErrCtxt>::report_fulfillment_error
19: 0x7f2934788b69 - <rustc_trait_selection[80cf404ec0a5bee9]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
20: 0x7f293796d35c - rustc_hir_typeck[44769868edd0f557]::typeck_with_inspect::{closure#0}
21: 0x7f293795fc70 - rustc_query_impl[13b9a2342661e590]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
22: 0x7f293715b0b5 - rustc_query_impl[13b9a2342661e590]::execution::try_execute_query::<rustc_data_structures[1fe83761f21b0d17]::vec_cache::VecCache<rustc_span[130017d5cd07ffae]::def_id::LocalDefId, rustc_middle[398bfe4e000b8183]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[398bfe4e000b8183]::dep_graph::graph::DepNodeIndex>, false>
23: 0x7f293715aa43 - rustc_query_impl[13b9a2342661e590]::query_impl::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
24: 0x7f2936e35390 - rustc_hir_analysis[81d558729a90fdc1]::check_crate
25: 0x7f293715c5ba - rustc_interface[f85a6de8440246ff]::passes::analysis
26: 0x7f293780b50a - rustc_query_impl[13b9a2342661e590]::execution::try_execute_query::<rustc_middle[398bfe4e000b8183]::query::caches::SingleCache<rustc_middle[398bfe4e000b8183]::query::erase::ErasedData<[u8; 0usize]>>, false>
27: 0x7f293780b2e9 - rustc_query_impl[13b9a2342661e590]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
28: 0x7f29378722f5 - rustc_interface[f85a6de8440246ff]::interface::run_compiler::<(), rustc_driver_impl[babd6b97ed827c3b]::run_compiler::{closure#0}>::{closure#2}
29: 0x7f29378b2ea4 - std[76c4f663cfdf9de9]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f85a6de8440246ff]::util::run_in_thread_with_globals<rustc_interface[f85a6de8440246ff]::util::run_in_thread_pool_with_globals<rustc_interface[f85a6de8440246ff]::interface::run_compiler<(), rustc_driver_impl[babd6b97ed827c3b]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
30: 0x7f29378b2c6d - <std[76c4f663cfdf9de9]::thread::lifecycle::spawn_unchecked<rustc_interface[f85a6de8440246ff]::util::run_in_thread_with_globals<rustc_interface[f85a6de8440246ff]::util::run_in_thread_pool_with_globals<rustc_interface[f85a6de8440246ff]::interface::run_compiler<(), rustc_driver_impl[babd6b97ed827c3b]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[e73040c94e2c05fb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
31: 0x7f29378af8fa - <std[76c4f663cfdf9de9]::sys::thread::unix::Thread>::new::thread_start
32: 0x7f2930c97739 - <unknown>
33: 0x7f2930d1bedc - <unknown>
34: 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.99.0-nightly (87212cef7 2026-08-05) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [fn_sig] computing function signature of `core::option::Option::None`
#1 [typeck_root] type-checking `main`
#2 [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 E0618`.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.