@@ -160,9 +160,15 @@ pub use std::{thread, thread_local};
160
160
pub mod cell {
161
161
pub use std:: cell:: * ;
162
162
163
- #[ derive( Debug ) ]
164
163
pub ( crate ) struct UnsafeCell < T > ( core:: cell:: UnsafeCell < T > ) ;
165
164
165
+ // this is not derived because it confuses rust-analyzer ... https://github.com/rust-lang/rust-analyzer/issues/19755
166
+ impl < T : std:: fmt:: Debug > std:: fmt:: Debug for UnsafeCell < T > {
167
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
168
+ f. debug_tuple ( "UnsafeCell" ) . field ( & self . 0 ) . finish ( )
169
+ }
170
+ }
171
+
166
172
impl < T > UnsafeCell < T > {
167
173
pub const fn new ( data : T ) -> UnsafeCell < T > {
168
174
UnsafeCell ( core:: cell:: UnsafeCell :: new ( data) )
@@ -216,9 +222,23 @@ pub mod sync {
216
222
}
217
223
218
224
/// A wrapper around parking-lot's `Condvar` to mirror loom's API.
219
- #[ derive( Default , Debug ) ]
220
225
pub struct Condvar ( parking_lot:: Condvar ) ;
221
226
227
+ // this is not derived because it confuses rust-analyzer ... https://github.com/rust-lang/rust-analyzer/issues/19755
228
+ #[ allow( clippy:: derivable_impls) ]
229
+ impl Default for Condvar {
230
+ fn default ( ) -> Self {
231
+ Self ( Default :: default ( ) )
232
+ }
233
+ }
234
+
235
+ // this is not derived because it confuses rust-analyzer ... https://github.com/rust-lang/rust-analyzer/issues/19755
236
+ impl std:: fmt:: Debug for Condvar {
237
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
238
+ f. debug_tuple ( "Condvar" ) . field ( & self . 0 ) . finish ( )
239
+ }
240
+ }
241
+
222
242
impl Condvar {
223
243
pub fn wait < ' a , T > ( & self , mut guard : MutexGuard < ' a , T > ) -> MutexGuard < ' a , T > {
224
244
self . 0 . wait ( & mut guard) ;
0 commit comments