Skip to content

Commit 76bf7c0

Browse files
authored
Rollup merge of #86785 - lf-:dead-code, r=Mark-Simulacrum
proc_macro/bridge: Remove dead code Slice type See rust-lang/rust#85390 (comment)
2 parents 3ec8e6c + 0b3fedc commit 76bf7c0

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

library/proc_macro/src/bridge/buffer.rs

-29
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,6 @@ use std::mem;
55
use std::ops::{Deref, DerefMut};
66
use std::slice;
77

8-
#[repr(C)]
9-
struct Slice<'a, T> {
10-
data: &'a [T; 0],
11-
len: usize,
12-
}
13-
14-
unsafe impl<'a, T: Sync> Sync for Slice<'a, T> {}
15-
unsafe impl<'a, T: Sync> Send for Slice<'a, T> {}
16-
17-
impl<T> Copy for Slice<'a, T> {}
18-
impl<T> Clone for Slice<'a, T> {
19-
fn clone(&self) -> Self {
20-
*self
21-
}
22-
}
23-
24-
impl<T> From<&'a [T]> for Slice<'a, T> {
25-
fn from(xs: &'a [T]) -> Self {
26-
Slice { data: unsafe { &*(xs.as_ptr() as *const [T; 0]) }, len: xs.len() }
27-
}
28-
}
29-
30-
impl<T> Deref for Slice<'a, T> {
31-
type Target = [T];
32-
fn deref(&self) -> &[T] {
33-
unsafe { slice::from_raw_parts(self.data.as_ptr(), self.len) }
34-
}
35-
}
36-
378
#[repr(C)]
389
pub struct Buffer<T: Copy> {
3910
data: *mut T,

0 commit comments

Comments
 (0)