Closed
Description
This reduced testcase is getting miscompiled with mir-opt-level=2
. I bisected it to #64890.
fn encode(this: ((), u8, u8)) {
// this assert panics although this.2 is 0
assert!(this.2 == 0);
}
fn emit() {
encode(((), 0, 0));
}
fn emit_inc() -> Box<()> {
emit();
Box::new(())
}
fn main() {
emit_inc();
}
Rust version:
rustc 1.41.0-nightly (4007d4ef2 2019-12-01)
binary: rustc
commit-hash: 4007d4ef26eab44bdabc2b7574d032152264d3ad
commit-date: 2019-12-01
host: x86_64-apple-darwin
release: 1.41.0-nightly
LLVM version: 9.0
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlCategory: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.