@@ -78,18 +78,23 @@ pub(crate) use make_c_str;
78
78
/// the memory associated with the pointer using corresponding driver's API function.
79
79
pub trait BoxFFI {
80
80
fn into_ptr ( self : Box < Self > ) -> * mut Self {
81
+ #[ allow( clippy:: disallowed_methods) ]
81
82
Box :: into_raw ( self )
82
83
}
83
84
unsafe fn from_ptr ( ptr : * mut Self ) -> Box < Self > {
85
+ #[ allow( clippy:: disallowed_methods) ]
84
86
Box :: from_raw ( ptr)
85
87
}
86
88
unsafe fn maybe_as_ref < ' a > ( ptr : * const Self ) -> Option < & ' a Self > {
89
+ #[ allow( clippy:: disallowed_methods) ]
87
90
ptr. as_ref ( )
88
91
}
89
92
unsafe fn as_ref < ' a > ( ptr : * const Self ) -> & ' a Self {
93
+ #[ allow( clippy:: disallowed_methods) ]
90
94
ptr. as_ref ( ) . unwrap ( )
91
95
}
92
96
unsafe fn as_mut_ref < ' a > ( ptr : * mut Self ) -> & ' a mut Self {
97
+ #[ allow( clippy:: disallowed_methods) ]
93
98
ptr. as_mut ( ) . unwrap ( )
94
99
}
95
100
unsafe fn free ( ptr : * mut Self ) {
@@ -107,22 +112,29 @@ pub trait BoxFFI {
107
112
/// This trait does not support interior mutability. For this, see [`MutArcFFI`].
108
113
pub trait ArcFFI {
109
114
fn as_ptr ( self : & Arc < Self > ) -> * const Self {
115
+ #[ allow( clippy:: disallowed_methods) ]
110
116
Arc :: as_ptr ( self )
111
117
}
112
118
fn into_ptr ( self : Arc < Self > ) -> * const Self {
119
+ #[ allow( clippy:: disallowed_methods) ]
113
120
Arc :: into_raw ( self )
114
121
}
115
122
unsafe fn from_ptr ( ptr : * const Self ) -> Arc < Self > {
123
+ #[ allow( clippy:: disallowed_methods) ]
116
124
Arc :: from_raw ( ptr)
117
125
}
118
126
unsafe fn cloned_from_ptr ( ptr : * const Self ) -> Arc < Self > {
127
+ #[ allow( clippy:: disallowed_methods) ]
119
128
Arc :: increment_strong_count ( ptr) ;
129
+ #[ allow( clippy:: disallowed_methods) ]
120
130
Arc :: from_raw ( ptr)
121
131
}
122
132
unsafe fn maybe_as_ref < ' a > ( ptr : * const Self ) -> Option < & ' a Self > {
133
+ #[ allow( clippy:: disallowed_methods) ]
123
134
ptr. as_ref ( )
124
135
}
125
136
unsafe fn as_ref < ' a > ( ptr : * const Self ) -> & ' a Self {
137
+ #[ allow( clippy:: disallowed_methods) ]
126
138
ptr. as_ref ( ) . unwrap ( )
127
139
}
128
140
unsafe fn free ( ptr : * const Self ) {
@@ -143,6 +155,7 @@ pub trait RefFFI {
143
155
self as * const Self
144
156
}
145
157
unsafe fn as_ref < ' a > ( ptr : * const Self ) -> & ' a Self {
158
+ #[ allow( clippy:: disallowed_methods) ]
146
159
ptr. as_ref ( ) . unwrap ( )
147
160
}
148
161
}
0 commit comments