File tree Expand file tree Collapse file tree 3 files changed +3
-52
lines changed Expand file tree Collapse file tree 3 files changed +3
-52
lines changed Original file line number Diff line number Diff line change 4
4
//!
5
5
//! TODO: This module is a work in progress.
6
6
7
- use alloc:: { boxed:: Box , sync :: Arc } ;
7
+ use alloc:: boxed:: Box ;
8
8
use core:: ptr:: NonNull ;
9
9
10
10
pub use crate :: raw_list:: { Cursor , GetLinks , Links } ;
@@ -41,20 +41,6 @@ impl<T: ?Sized> Wrapper<T> for Box<T> {
41
41
}
42
42
}
43
43
44
- impl < T : ?Sized > Wrapper < T > for Arc < T > {
45
- fn into_pointer ( self ) -> NonNull < T > {
46
- NonNull :: new ( Arc :: into_raw ( self ) as _ ) . unwrap ( )
47
- }
48
-
49
- unsafe fn from_pointer ( ptr : NonNull < T > ) -> Self {
50
- unsafe { Arc :: from_raw ( ptr. as_ptr ( ) ) }
51
- }
52
-
53
- fn as_ref ( & self ) -> & T {
54
- AsRef :: as_ref ( self )
55
- }
56
- }
57
-
58
44
impl < T : ?Sized > Wrapper < T > for Ref < T > {
59
45
fn into_pointer ( self ) -> NonNull < T > {
60
46
NonNull :: new ( Ref :: into_raw ( self ) as _ ) . unwrap ( )
@@ -104,20 +90,6 @@ impl<T: GetLinks + ?Sized> GetLinks for Box<T> {
104
90
}
105
91
}
106
92
107
- impl < T : ?Sized > GetLinksWrapped for Arc < T >
108
- where
109
- Arc < T > : GetLinks ,
110
- {
111
- type Wrapped = Arc < <Arc < T > as GetLinks >:: EntryType > ;
112
- }
113
-
114
- impl < T : GetLinks + ?Sized > GetLinks for Arc < T > {
115
- type EntryType = T :: EntryType ;
116
- fn get_links ( data : & Self :: EntryType ) -> & Links < Self :: EntryType > {
117
- <T as GetLinks >:: get_links ( data)
118
- }
119
- }
120
-
121
93
impl < T : ?Sized > GetLinksWrapped for Ref < T >
122
94
where
123
95
Ref < T > : GetLinks ,
Original file line number Diff line number Diff line change 13
13
14
14
pub use core:: pin:: Pin ;
15
15
16
- pub use alloc:: { boxed:: Box , string:: String , sync :: Arc , vec:: Vec } ;
16
+ pub use alloc:: { boxed:: Box , string:: String , vec:: Vec } ;
17
17
18
18
pub use macros:: { module, module_misc_device} ;
19
19
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use crate::{
8
8
bindings, c_types,
9
9
sync:: { Ref , RefBorrow } ,
10
10
} ;
11
- use alloc:: { boxed:: Box , sync :: Arc } ;
11
+ use alloc:: boxed:: Box ;
12
12
use core:: { ops:: Deref , pin:: Pin , ptr:: NonNull } ;
13
13
14
14
/// Permissions.
@@ -100,27 +100,6 @@ impl<T> PointerWrapper for Ref<T> {
100
100
}
101
101
}
102
102
103
- impl < T > PointerWrapper for Arc < T > {
104
- type Borrowed = UnsafeReference < T > ;
105
-
106
- fn into_pointer ( self ) -> * const c_types:: c_void {
107
- Arc :: into_raw ( self ) as _
108
- }
109
-
110
- unsafe fn borrow ( ptr : * const c_types:: c_void ) -> Self :: Borrowed {
111
- // SAFETY: The safety requirements for this function ensure that the object is still alive,
112
- // so it is safe to dereference the raw pointer.
113
- // The safety requirements also ensure that the object remains alive for the lifetime of
114
- // the returned value.
115
- unsafe { UnsafeReference :: new ( & * ptr. cast ( ) ) }
116
- }
117
-
118
- unsafe fn from_pointer ( ptr : * const c_types:: c_void ) -> Self {
119
- // SAFETY: The passed pointer comes from a previous call to [`Self::into_pointer()`].
120
- unsafe { Arc :: from_raw ( ptr as _ ) }
121
- }
122
- }
123
-
124
103
/// A reference with manually-managed lifetime.
125
104
///
126
105
/// # Invariants
You can’t perform that action at this time.
0 commit comments