소스 검색

Merge pull request #421 from JohnTitor/unused-import

Suppress some warnings
Amanieu d'Antras 3 년 전
부모
커밋
612ddf84c5
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/arm.rs
  2. 3 0
      src/mem/mod.rs

+ 1 - 0
src/arm.rs

@@ -1,4 +1,5 @@
 #![cfg(not(feature = "no-asm"))]
 #![cfg(not(feature = "no-asm"))]
+#![allow(unused_imports)]
 
 
 use core::intrinsics;
 use core::intrinsics;
 
 

+ 3 - 0
src/mem/mod.rs

@@ -69,6 +69,7 @@ pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
 }
 }
 
 
 // `bytes` must be a multiple of `mem::size_of::<T>()`
 // `bytes` must be a multiple of `mem::size_of::<T>()`
+#[cfg_attr(not(target_has_atomic_load_store = "8"), allow(dead_code))]
 fn memcpy_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes: usize) {
 fn memcpy_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes: usize) {
     unsafe {
     unsafe {
         let n = exact_div(bytes, mem::size_of::<T>());
         let n = exact_div(bytes, mem::size_of::<T>());
@@ -81,6 +82,7 @@ fn memcpy_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes:
 }
 }
 
 
 // `bytes` must be a multiple of `mem::size_of::<T>()`
 // `bytes` must be a multiple of `mem::size_of::<T>()`
+#[cfg_attr(not(target_has_atomic_load_store = "8"), allow(dead_code))]
 fn memmove_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes: usize) {
 fn memmove_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes: usize) {
     unsafe {
     unsafe {
         let n = exact_div(bytes, mem::size_of::<T>());
         let n = exact_div(bytes, mem::size_of::<T>());
@@ -103,6 +105,7 @@ fn memmove_element_unordered_atomic<T: Copy>(dest: *mut T, src: *const T, bytes:
 }
 }
 
 
 // `T` must be a primitive integer type, and `bytes` must be a multiple of `mem::size_of::<T>()`
 // `T` must be a primitive integer type, and `bytes` must be a multiple of `mem::size_of::<T>()`
+#[cfg_attr(not(target_has_atomic_load_store = "8"), allow(dead_code))]
 fn memset_element_unordered_atomic<T>(s: *mut T, c: u8, bytes: usize)
 fn memset_element_unordered_atomic<T>(s: *mut T, c: u8, bytes: usize)
 where
 where
     T: Copy + From<u8> + Shl<u32, Output = T> + BitOr<T, Output = T>,
     T: Copy + From<u8> + Shl<u32, Output = T> + BitOr<T, Output = T>,