Skip to content

Commit 327b923

Browse files
committed
Auto merge of #803 - alexcrichton:no-intrinsics, r=kvark
Avoid using the std::intrinsics module This is actually unstable but [there's a bug][bug] in the compiler allowing it to be used. Good news is that these functions are available stable elsewhere! [bug]: rust-lang/rust#28075
2 parents 6ef8112 + 272dc46 commit 327b923

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/src/device/draw.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ impl DataBuffer {
5555
/// Copy a given structure into the buffer, return the offset and the size.
5656
#[cfg(not(unstable))]
5757
pub fn add_struct<T: Copy>(&mut self, v: &T) -> DataPointer {
58-
use std::{intrinsics, mem};
58+
use std::{ptr, mem};
5959
let offset = self.buf.len();
6060
let size = mem::size_of::<T>();
6161
self.buf.reserve(size);
6262
unsafe {
6363
self.buf.set_len(offset + size);
64-
intrinsics::copy((v as *const T) as *const u8,
64+
ptr::copy((v as *const T) as *const u8,
6565
&mut self.buf[offset] as *mut u8,
6666
size);
6767
};
@@ -70,13 +70,13 @@ impl DataBuffer {
7070

7171
/// Copy a given vector slice into the buffer
7272
pub fn add_vec<T: Copy>(&mut self, v: &[T]) -> DataPointer {
73-
use std::{intrinsics, mem};
73+
use std::{ptr, mem};
7474
let offset = self.buf.len();
7575
let size = mem::size_of::<T>() * v.len();
7676
self.buf.reserve(size);
7777
unsafe {
7878
self.buf.set_len(offset + size);
79-
intrinsics::copy(v.as_ptr() as *const u8,
79+
ptr::copy(v.as_ptr() as *const u8,
8080
&mut self.buf[offset] as *mut u8,
8181
size);
8282
}

0 commit comments

Comments
 (0)