aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs
blob: c46a97d1539bd34ad569d35ee4e80cb1d23b8c70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![feature(intrinsics)]

#[lang = "sized"]
pub trait Sized {}

mod mem {
    extern "rust-intrinsic" {
        pub fn size_of<T>() -> usize;
    }
}

mod ptr {

    pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) {
        let x = x as *mut T;
        let y = y as *mut T;
        let len = crate::mem::size_of::<T>() * count;
    }
}