about summary refs log tree commit diff
path: root/tests/ui/mir/lint/assignment-overlap.rs
blob: 6396cccd4e88c2fe986a92bd971770b2a62227cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ 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()
        }
    }
}