df116ec246
The check attempts to identify potential undefined behaviour, rather than whether MIR is well-formed. It belongs in the lint not validator.
20 lines
473 B
Rust
20 lines
473 B
Rust
// compile-flags: --crate-type=lib -Zlint-mir -Ztreat-err-as-bug
|
|
// build-fail
|
|
// failure-status: 101
|
|
// dont-check-compiler-stderr
|
|
// error-pattern: encountered `Assign` statement with overlapping memory
|
|
#![feature(custom_mir, core_intrinsics)]
|
|
extern crate core;
|
|
use core::intrinsics::mir::*;
|
|
|
|
#[custom_mir(dialect = "runtime", phase = "optimized")]
|
|
pub fn main() {
|
|
mir!(
|
|
let a: [u8; 1024];
|
|
{
|
|
a = a;
|
|
Return()
|
|
}
|
|
)
|
|
}
|