rust/tests/ui/mir/lint/assignment-overlap.rs
Vadim Petrochenkov 56d6b4e427 compiletest: Support matching on non-json lines in compiler output
and migrate most of remaining `error-pattern`s to it.
2025-05-04 18:27:45 +03:00

21 lines
512 B
Rust

//@ compile-flags: --crate-type=lib -Zlint-mir -Ztreat-err-as-bug
//@ build-fail
//@ failure-status: 101
//@ dont-check-compiler-stderr
#![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; //~ ERROR broken MIR
//~^ ERROR encountered `Assign` statement with overlapping memory
Return()
}
}
}