about summary refs log tree commit diff
path: root/tests/ui/mir/lint/assignment-overlap.rs
blob: 5d1213a77585fd7503c1e914efad4539368e1df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ 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 `_1 = copy _1` statement with overlapping memory
            Return()
        }
    }
}