rust-lang / rust

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

ICE: `Invalid float op Neg` #124583

Closed matthiaskrgr closed 4 months ago

matthiaskrgr commented 6 months ago

snippet:

fn main() {
    let _ = -(-0.0f16);
}

Version information

rustc 1.80.0-nightly (378a43a06 2024-05-01)
binary: rustc
commit-hash: 378a43a06510f3e3a49c69c8de71745e6a884048
commit-date: 2024-05-01
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[E0658]: the type `f16` is unstable --> /tmp/icemaker_global_tempdir.LUs0yTDS2O3R/rustc_testrunner_tmpdir_reporting.laee65vXPGyd/mvce.rs:2:16 | 2 | let _ = -(-0.0f16); | ^^^^^^ | = note: see issue #116909 for more information = help: add `#![feature(f16)]` to the crate attributes to enable = note: this compiler was built on 2024-05-01; consider upgrading it if it is out of date error: internal compiler error: /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/compiler/rustc_const_eval/src/interpret/operator.rs:498:26: Invalid float op Neg --> /tmp/icemaker_global_tempdir.LUs0yTDS2O3R/rustc_testrunner_tmpdir_reporting.laee65vXPGyd/mvce.rs:1:1 | 1 | fn main() { | ^^^^^^^^^ thread 'rustc' panicked at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/compiler/rustc_const_eval/src/interpret/operator.rs:498:26: Box stack backtrace: 0: 0x75fcab3ba035 - std::backtrace_rs::backtrace::libunwind::trace::hda47b82a166812ce at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5 1: 0x75fcab3ba035 - std::backtrace_rs::backtrace::trace_unsynchronized::hfdfc54f1e69a0c51 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x75fcab3ba035 - std::sys_common::backtrace::_print_fmt::h793b3f7571d13dfd at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:68:5 3: 0x75fcab3ba035 - ::fmt::hbc9f1fbbb950dc64 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:44:22 4: 0x75fcab40929b - core::fmt::rt::Argument::fmt::h616c7e5e48e69035 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/core/src/fmt/rt.rs:165:63 5: 0x75fcab40929b - core::fmt::write::h273cb7cce9dfa202 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/core/src/fmt/mod.rs:1157:21 6: 0x75fcab3aebdf - std::io::Write::write_fmt::h945d30311b10e894 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/io/mod.rs:1832:15 7: 0x75fcab3b9e0e - std::sys_common::backtrace::_print::hcdebe37872d00154 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:47:5 8: 0x75fcab3b9e0e - std::sys_common::backtrace::print::h51bd45a216cc9df6 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:34:9 9: 0x75fcab3bc779 - std::panicking::default_hook::{{closure}}::hb6bc4eb0d96a4bfd 10: 0x75fcab3bc4bd - std::panicking::default_hook::h557ff9f57d861b48 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/panicking.rs:298:9 11: 0x75fca7c3c6bb - std[8fa947ca3cb89c52]::panicking::update_hook::>::{closure#0} 12: 0x75fcab3bce76 - as core::ops::function::Fn>::call::hf5d9c19b8a775637 at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2036:9 13: 0x75fcab3bce76 - std::panicking::rust_panic_with_hook::h310a921a123719cf at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/panicking.rs:799:13 14: 0x75fca7c6c084 - std[8fa947ca3cb89c52]::panicking::begin_panic::::{closure#0} 15: 0x75fca7c68d06 - std[8fa947ca3cb89c52]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 16: 0x75fca7c689e6 - std[8fa947ca3cb89c52]::panicking::begin_panic:: 17: 0x75fca7c75261 - ::emit_producing_guarantee 18: 0x75fca822e208 - ::span_bug:: 19: 0x75fca824f6bd - rustc_middle[ec0047e274fe25be]::util::bug::opt_span_bug_fmt::::{closure#0} 20: 0x75fca824f6ea - rustc_middle[ec0047e274fe25be]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0} 21: 0x75fca824874b - rustc_middle[ec0047e274fe25be]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !> 22: 0x75fca8247f67 - rustc_middle[ec0047e274fe25be]::util::bug::span_bug_fmt:: 23: 0x75fcaa92bdef - >::overflowing_unary_op.cold 24: 0x75fca67bda02 - ::visit_assign 25: 0x75fca993d83d - ::visit_body 26: 0x75fca6999566 - ::run_lint 27: 0x75fca90018cd - rustc_mir_transform[61a8aa7cac63b4d6]::pass_manager::run_passes_inner 28: 0x75fca9395d42 - rustc_mir_transform[61a8aa7cac63b4d6]::mir_drops_elaborated_and_const_checked 29: 0x75fca93955fd - rustc_query_impl[1888158ad4449b9b]::plumbing::__rust_begin_short_backtrace::> 30: 0x75fca938d171 - rustc_query_system[b5ee5054546adc93]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[1888158ad4449b9b]::plumbing::QueryCtxt, false> 31: 0x75fca938cb2a - rustc_query_impl[1888158ad4449b9b]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace 32: 0x75fca936cff9 - rustc_interface[e7d426f81a3c67f]::passes::analysis 33: 0x75fca936bddb - rustc_query_impl[1888158ad4449b9b]::plumbing::__rust_begin_short_backtrace::> 34: 0x75fca9dfb4e5 - rustc_query_system[b5ee5054546adc93]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[1888158ad4449b9b]::plumbing::QueryCtxt, false> 35: 0x75fca9dfb249 - rustc_query_impl[1888158ad4449b9b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace 36: 0x75fca9c675ce - rustc_interface[e7d426f81a3c67f]::interface::run_compiler::, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1} 37: 0x75fca9c54167 - std[8fa947ca3cb89c52]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>> 38: 0x75fca9c53f2a - <::spawn_unchecked_, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#2} as core[19fe836d650da945]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 39: 0x75fcab3c6cab - as core::ops::function::FnOnce>::call_once::h32bd23449113524a at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2022:9 40: 0x75fcab3c6cab - as core::ops::function::FnOnce>::call_once::h04c486968e15e63c at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2022:9 41: 0x75fcab3c6cab - std::sys::pal::unix::thread::Thread::new::thread_start::ha93fdc6af5a412fe at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys/pal/unix/thread.rs:108:17 42: 0x75fcab16555a - 43: 0x75fcab1e2a3c - 44: 0x0 - 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 (378a43a06 2024-05-01) running on x86_64-unknown-linux-gnu query stack during panic: #0 [mir_drops_elaborated_and_const_checked] elaborating drops for `main` #1 [analysis] running analysis passes on this crate end of query stack error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. ```

tgross35 commented 6 months ago

Another thing waiting on const eval, like https://github.com/rust-lang/rust/issues/122587

@rustbot claim @rustbot label +requires-incomplete-features +S-bug-has-test +S-has-mcve -needs-triage

rustbot commented 6 months ago

Error: Parsing assign command in comment failed: ...' claim' | error: expected end of command at >| ' label +re'...

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