]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/missing_span_in_backtrace.rs
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
[rust.git] / tests / ui / consts / missing_span_in_backtrace.rs
1 // compile-flags: -Z ui-testing=no
2 // normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
3
4 #![feature(const_swap)]
5 #![feature(const_mut_refs)]
6 use std::{
7     mem::{self, MaybeUninit},
8     ptr,
9 };
10
11 const X: () = {
12     let mut ptr1 = &1;
13     let mut ptr2 = &2;
14
15     // Swap them, bytewise.
16     unsafe {
17         ptr::swap_nonoverlapping(
18             &mut ptr1 as *mut _ as *mut MaybeUninit<u8>,
19             &mut ptr2 as *mut _ as *mut MaybeUninit<u8>,
20             mem::size_of::<&i32>(),
21         );
22     }
23 };
24
25 fn main() {
26     X
27 }