Open
Description
Consider this code:
#![feature(custom_mir, core_intrinsics)]
use std::intrinsics::mir::*;
pub struct S(i32);
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn main() {
mir! {
let x: i32;
{
let _observe = x;
Return()
}
}
}
When running it in Miri, I wold expect this to point at the assignment. Instead it points at the entire mir!
block:
error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer
--> src/main.rs:8:5
|
8 | / mir! {
9 | | let x: i32;
10 | | {
11 | | let _observe = x;
... |
14 | |
15 | | }
| |_____^ constructing invalid value: encountered uninitialized memory, but expected an integer
I've seen it use proper spans for Call
terminators inside mir!
blocks so I hope this is just an oversight and easy to fix. :)
Cc @JakobDegen