Closed
Description
I tried this code on mips-unknown-linux-gnu
through cargo-cross
:
use std::net::{IpAddr, Ipv4Addr};
fn main() {
let value = IpAddr::V4(Ipv4Addr::new(31, 41, 59, 26));
assert_eq!(&value, &value);
}
cross run --target mips-unknown-linux-gnu --verbose
I expected to see this happen: the program exits successfully.
Instead, this happened: qemu: uncaught target signal 10 (Bus error) - core dumped
This is truly baffling because:
- This is extremely plain code, just a struct in an enum.
- This is crashing in the implementation of
PartialEq
which has been generated by a derive. - Removing the outer
IpAddr
does not cause a crash. - Far more complex code runs successfully.
If this is a problem with cargo-cross
instead, I would be happy to move the bug to the corresponding repo.
Meta
rustc --version --verbose
:
rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-pc-windows-msvc
release: 1.64.0
LLVM version: 14.0.6
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Category: This is a bug.Issue: Correct Rust code lowers to incorrect machine codeTarget: MIPS processorsRelevant to the compiler team, which will review and decide on the PR/issue.Issue expected to be fixed by the next major LLVM upgrade, or backported fixes