about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/overlapping_assignment_aggregate.rs
blob: 8d7b1946242c0f50b3308960a4e1bb543c6978cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! This is like `pass/overlapping_assignment_aggregate_scalar.rs` but with a non-scalar
//! type, and that makes it definite UB.
#![feature(custom_mir, core_intrinsics)]
#![allow(internal_features)]

use std::intrinsics::mir::*;

#[custom_mir(dialect = "runtime")]
fn main() {
    mir! {
        let _1: ([u8; 1],);
        {
            _1.0 = [0_u8; 1];
            _1 = (_1.0, ); //~ERROR: overlapping ranges
            Return()
        }
    }
}