@@ -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 ) {
@@ -105,22 +110,29 @@ pub trait BoxFFI {
105
110
/// with the pointer using corresponding driver's API function.
106
111
pub trait ArcFFI {
107
112
fn as_ptr ( self : & Arc < Self > ) -> * const Self {
113
+ #[ allow( clippy:: disallowed_methods) ]
108
114
Arc :: as_ptr ( self )
109
115
}
110
116
fn into_ptr ( self : Arc < Self > ) -> * const Self {
117
+ #[ allow( clippy:: disallowed_methods) ]
111
118
Arc :: into_raw ( self )
112
119
}
113
120
unsafe fn from_ptr ( ptr : * const Self ) -> Arc < Self > {
121
+ #[ allow( clippy:: disallowed_methods) ]
114
122
Arc :: from_raw ( ptr)
115
123
}
116
124
unsafe fn cloned_from_ptr ( ptr : * const Self ) -> Arc < Self > {
125
+ #[ allow( clippy:: disallowed_methods) ]
117
126
Arc :: increment_strong_count ( ptr) ;
127
+ #[ allow( clippy:: disallowed_methods) ]
118
128
Arc :: from_raw ( ptr)
119
129
}
120
130
unsafe fn maybe_as_ref < ' a > ( ptr : * const Self ) -> Option < & ' a Self > {
131
+ #[ allow( clippy:: disallowed_methods) ]
121
132
ptr. as_ref ( )
122
133
}
123
134
unsafe fn as_ref < ' a > ( ptr : * const Self ) -> & ' a Self {
135
+ #[ allow( clippy:: disallowed_methods) ]
124
136
ptr. as_ref ( ) . unwrap ( )
125
137
}
126
138
unsafe fn free ( ptr : * const Self ) {
@@ -141,6 +153,7 @@ pub trait RefFFI {
141
153
self as * const Self
142
154
}
143
155
unsafe fn as_ref < ' a > ( ptr : * const Self ) -> & ' a Self {
156
+ #[ allow( clippy:: disallowed_methods) ]
144
157
ptr. as_ref ( ) . unwrap ( )
145
158
}
146
159
}
0 commit comments