@@ -348,11 +348,9 @@ pub mod unsync {
348
348
cell:: { Cell , UnsafeCell } ,
349
349
fmt, hint, mem,
350
350
ops:: { Deref , DerefMut } ,
351
+ panic:: { RefUnwindSafe , UnwindSafe } ,
351
352
} ;
352
353
353
- #[ cfg( feature = "std" ) ]
354
- use std:: panic:: { RefUnwindSafe , UnwindSafe } ;
355
-
356
354
/// A cell which can be written to only once. It is not thread safe.
357
355
///
358
356
/// Unlike [`std::cell::RefCell`], a `OnceCell` provides simple `&`
@@ -382,9 +380,7 @@ pub mod unsync {
382
380
// `&unsync::OnceCell` to sneak a `T` through `catch_unwind`,
383
381
// by initializing the cell in closure and extracting the value in the
384
382
// `Drop`.
385
- #[ cfg( feature = "std" ) ]
386
383
impl < T : RefUnwindSafe + UnwindSafe > RefUnwindSafe for OnceCell < T > { }
387
- #[ cfg( feature = "std" ) ]
388
384
impl < T : UnwindSafe > UnwindSafe for OnceCell < T > { }
389
385
390
386
impl < T > Default for OnceCell < T > {
@@ -680,7 +676,6 @@ pub mod unsync {
680
676
init : Cell < Option < F > > ,
681
677
}
682
678
683
- #[ cfg( feature = "std" ) ]
684
679
impl < T , F : RefUnwindSafe > RefUnwindSafe for Lazy < T , F > where OnceCell < T > : RefUnwindSafe { }
685
680
686
681
impl < T : fmt:: Debug , F > fmt:: Debug for Lazy < T , F > {
@@ -1225,7 +1220,6 @@ pub mod sync {
1225
1220
unsafe impl < T , F : Send > Sync for Lazy < T , F > where OnceCell < T > : Sync { }
1226
1221
// auto-derived `Send` impl is OK.
1227
1222
1228
- #[ cfg( feature = "std" ) ]
1229
1223
impl < T , F : RefUnwindSafe > RefUnwindSafe for Lazy < T , F > where OnceCell < T > : RefUnwindSafe { }
1230
1224
1231
1225
impl < T , F > Lazy < T , F > {
0 commit comments