about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJade <software@lfcode.ca>2021-07-01 10:20:57 -0700
committerJade <software@lfcode.ca>2021-07-01 10:20:57 -0700
commit0b3fedc8df1c102a9a7ea7b345e8105e91676f93 (patch)
tree8ceab1359837df5405c2818e3139b3d455a9bb60
parent64de4979e8979836e7c029d69eb96e6f7da66185 (diff)
downloadrust-0b3fedc8df1c102a9a7ea7b345e8105e91676f93.tar.gz
rust-0b3fedc8df1c102a9a7ea7b345e8105e91676f93.zip
proc_macro/bridge: Remove dead code Slice type
See https://github.com/rust-lang/rust/pull/85390#discussion_r662464868
-rw-r--r--library/proc_macro/src/bridge/buffer.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/library/proc_macro/src/bridge/buffer.rs b/library/proc_macro/src/bridge/buffer.rs
index 717201aef10..d82669d3e23 100644
--- a/library/proc_macro/src/bridge/buffer.rs
+++ b/library/proc_macro/src/bridge/buffer.rs
@@ -6,35 +6,6 @@ use std::ops::{Deref, DerefMut};
 use std::slice;
 
 #[repr(C)]
-struct Slice<'a, T> {
-    data: &'a [T; 0],
-    len: usize,
-}
-
-unsafe impl<'a, T: Sync> Sync for Slice<'a, T> {}
-unsafe impl<'a, T: Sync> Send for Slice<'a, T> {}
-
-impl<T> Copy for Slice<'a, T> {}
-impl<T> Clone for Slice<'a, T> {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-
-impl<T> From<&'a [T]> for Slice<'a, T> {
-    fn from(xs: &'a [T]) -> Self {
-        Slice { data: unsafe { &*(xs.as_ptr() as *const [T; 0]) }, len: xs.len() }
-    }
-}
-
-impl<T> Deref for Slice<'a, T> {
-    type Target = [T];
-    fn deref(&self) -> &[T] {
-        unsafe { slice::from_raw_parts(self.data.as_ptr(), self.len) }
-    }
-}
-
-#[repr(C)]
 pub struct Buffer<T: Copy> {
     data: *mut T,
     len: usize,