File tree Expand file tree Collapse file tree 1 file changed +0
-29
lines changed
library/proc_macro/src/bridge Expand file tree Collapse file tree 1 file changed +0
-29
lines changed Original file line number Diff line number Diff line change @@ -5,35 +5,6 @@ use std::mem;
55use std:: ops:: { Deref , DerefMut } ;
66use 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 ) ]
389pub struct Buffer < T : Copy > {
3910 data : * mut T ,
You can’t perform that action at this time.
0 commit comments