Closed
Description
rustc
contains a MIR validation pass which detects ill-formed MIR. Currently Miri does not report MIR validation failures, but should it?
For instance, in runtime MIR, Deref
must the the first projection if one exists. This code (rust-lang/rust#110228) performs a dereference after a field projection, so it fails MIR validation, but Miri runs this without any complaint
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;
#[custom_mir(dialect = "runtime", phase = "optimized")]
pub fn fn0() {
mir! {
let x: i32;
let tuple: (*mut i32,);
{
tuple.0 = core::ptr::addr_of_mut!(x);
*(tuple.0) = 1;
Return()
}
}
}
pub fn main() {
fn0();
}
Metadata
Metadata
Assignees
Labels
No labels