63
63
//! [`pin_init!`]. The syntax is almost the same as normal `struct` initializers. The difference is
64
64
//! that you need to write `<-` instead of `:` for fields that you want to initialize in-place.
65
65
//!
66
- //! ```rust,ignore
66
+ //! ```rust
67
67
//! # #![expect(clippy::disallowed_names)]
68
68
//! # #![feature(allocator_api)]
69
69
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
87
87
//! `foo` now is of the type [`impl PinInit<Foo>`]. We can now use any smart pointer that we like
88
88
//! (or just the stack) to actually initialize a `Foo`:
89
89
//!
90
- //! ```rust,ignore
90
+ //! ```rust
91
91
//! # #![expect(clippy::disallowed_names)]
92
92
//! # #![feature(allocator_api)]
93
93
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
115
115
//! Many types that use this library supply a function/macro that returns an initializer, because
116
116
//! the above method only works for types where you can access the fields.
117
117
//!
118
- //! ```rust,ignore
118
+ //! ```rust
119
119
//! # #![feature(allocator_api)]
120
120
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
121
121
//! # use pin_init::*;
126
126
//!
127
127
//! To declare an init macro/function you just return an [`impl PinInit<T, E>`]:
128
128
//!
129
- //! ```rust,ignore
129
+ //! ```rust
130
130
//! # #![feature(allocator_api)]
131
131
//! # use pin_init::*;
132
132
//! # #[path = "../examples/error.rs"] mod error; use error::Error;
162
162
//! - you may assume that `slot` will stay pinned even after the closure returns until `drop` of
163
163
//! `slot` gets called.
164
164
//!
165
- //! ```rust,ignore
165
+ //! ```rust
166
166
//! # #![feature(extern_types)]
167
167
//! use pin_init::{pin_data, pinned_drop, PinInit, PinnedDrop, pin_init_from_closure};
168
168
//! use core::{
@@ -306,7 +306,7 @@ pub use alloc::InPlaceInit;
306
306
///
307
307
/// # Examples
308
308
///
309
- /// ```ignore
309
+ /// ```
310
310
/// # #![feature(allocator_api)]
311
311
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
312
312
/// use pin_init::pin_data;
@@ -323,7 +323,7 @@ pub use alloc::InPlaceInit;
323
323
/// }
324
324
/// ```
325
325
///
326
- /// ```ignore
326
+ /// ```
327
327
/// # #![feature(allocator_api)]
328
328
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
329
329
/// # mod bindings { pub struct info; pub unsafe fn destroy_info(_: *mut info) {} }
@@ -357,7 +357,7 @@ pub use ::pin_init_internal::pin_data;
357
357
///
358
358
/// # Examples
359
359
///
360
- /// ```ignore
360
+ /// ```
361
361
/// # #![feature(allocator_api)]
362
362
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
363
363
/// # mod bindings { pub struct info; pub unsafe fn destroy_info(_: *mut info) {} }
@@ -391,7 +391,7 @@ pub use ::pin_init_internal::pinned_drop;
391
391
///
392
392
/// # Examples
393
393
///
394
- /// ```ignore
394
+ /// ```
395
395
/// use pin_init::Zeroable;
396
396
///
397
397
/// #[derive(Zeroable)]
@@ -407,7 +407,7 @@ pub use ::pin_init_internal::Zeroable;
407
407
///
408
408
/// # Examples
409
409
///
410
- /// ```rust,ignore
410
+ /// ```rust
411
411
/// # #![expect(clippy::disallowed_names)]
412
412
/// # #![feature(allocator_api)]
413
413
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
@@ -459,7 +459,7 @@ macro_rules! stack_pin_init {
459
459
///
460
460
/// # Examples
461
461
///
462
- /// ```rust,ignore
462
+ /// ```rust
463
463
/// # #![expect(clippy::disallowed_names)]
464
464
/// # #![feature(allocator_api)]
465
465
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
@@ -486,7 +486,7 @@ macro_rules! stack_pin_init {
486
486
/// println!("a: {}", &*foo.a.lock());
487
487
/// ```
488
488
///
489
- /// ```rust,ignore
489
+ /// ```rust
490
490
/// # #![expect(clippy::disallowed_names)]
491
491
/// # #![feature(allocator_api)]
492
492
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
@@ -539,7 +539,7 @@ macro_rules! stack_try_pin_init {
539
539
///
540
540
/// The syntax is almost identical to that of a normal `struct` initializer:
541
541
///
542
- /// ```rust,ignore
542
+ /// ```rust
543
543
/// # use pin_init::*;
544
544
/// # use core::pin::Pin;
545
545
/// #[pin_data]
@@ -583,7 +583,7 @@ macro_rules! stack_try_pin_init {
583
583
///
584
584
/// To create an initializer function, simply declare it like this:
585
585
///
586
- /// ```rust,ignore
586
+ /// ```rust
587
587
/// # use pin_init::*;
588
588
/// # use core::pin::Pin;
589
589
/// # #[pin_data]
@@ -609,7 +609,7 @@ macro_rules! stack_try_pin_init {
609
609
///
610
610
/// Users of `Foo` can now create it like this:
611
611
///
612
- /// ```rust,ignore
612
+ /// ```rust
613
613
/// # #![expect(clippy::disallowed_names)]
614
614
/// # use pin_init::*;
615
615
/// # use core::pin::Pin;
@@ -637,7 +637,7 @@ macro_rules! stack_try_pin_init {
637
637
///
638
638
/// They can also easily embed it into their own `struct`s:
639
639
///
640
- /// ```rust,ignore
640
+ /// ```rust
641
641
/// # use pin_init::*;
642
642
/// # use core::pin::Pin;
643
643
/// # #[pin_data]
@@ -696,7 +696,7 @@ macro_rules! stack_try_pin_init {
696
696
///
697
697
/// For instance:
698
698
///
699
- /// ```rust,ignore
699
+ /// ```rust
700
700
/// # use pin_init::*;
701
701
/// # use core::{ptr::addr_of_mut, marker::PhantomPinned};
702
702
/// #[pin_data]
@@ -750,7 +750,7 @@ macro_rules! pin_init {
750
750
///
751
751
/// # Examples
752
752
///
753
- /// ```rust,ignore
753
+ /// ```rust
754
754
/// # #![feature(allocator_api)]
755
755
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
756
756
/// use pin_init::{pin_data, try_pin_init, PinInit, InPlaceInit, zeroed};
@@ -857,7 +857,7 @@ macro_rules! init {
857
857
///
858
858
/// # Examples
859
859
///
860
- /// ```rust,ignore
860
+ /// ```rust
861
861
/// # #![feature(allocator_api)]
862
862
/// # use core::alloc::AllocError;
863
863
/// # use pin_init::InPlaceInit;
@@ -904,7 +904,7 @@ macro_rules! try_init {
904
904
/// # Example
905
905
///
906
906
/// This will succeed:
907
- /// ```ignore
907
+ /// ```
908
908
/// use pin_init::{pin_data, assert_pinned};
909
909
///
910
910
/// #[pin_data]
@@ -917,7 +917,7 @@ macro_rules! try_init {
917
917
/// ```
918
918
///
919
919
/// This will fail:
920
- /// ```compile_fail,ignore
920
+ /// ```compile_fail
921
921
/// use pin_init::{pin_data, assert_pinned};
922
922
///
923
923
/// #[pin_data]
@@ -931,7 +931,7 @@ macro_rules! try_init {
931
931
/// Some uses of the macro may trigger the `can't use generic parameters from outer item` error. To
932
932
/// work around this, you may pass the `inline` parameter to the macro. The `inline` parameter can
933
933
/// only be used when the macro is invoked from a function body.
934
- /// ```ignore
934
+ /// ```
935
935
/// # use core::pin::Pin;
936
936
/// use pin_init::{pin_data, assert_pinned};
937
937
///
@@ -1018,7 +1018,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
1018
1018
///
1019
1019
/// # Examples
1020
1020
///
1021
- /// ```rust,ignore
1021
+ /// ```rust
1022
1022
/// # #![feature(allocator_api)]
1023
1023
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1024
1024
/// # use pin_init::*;
@@ -1116,7 +1116,7 @@ pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
1116
1116
///
1117
1117
/// # Examples
1118
1118
///
1119
- /// ```rust,ignore
1119
+ /// ```rust
1120
1120
/// # #![expect(clippy::disallowed_names)]
1121
1121
/// use pin_init::{init, zeroed, Init};
1122
1122
///
@@ -1229,7 +1229,7 @@ pub fn uninit<T, E>() -> impl Init<MaybeUninit<T>, E> {
1229
1229
///
1230
1230
/// # Examples
1231
1231
///
1232
- /// ```rust,ignore
1232
+ /// ```rust
1233
1233
/// # use pin_init::*;
1234
1234
/// use pin_init::init_array_from_fn;
1235
1235
/// let array: Box<[usize; 1_000]> = Box::init(init_array_from_fn(|i| i)).unwrap();
@@ -1267,7 +1267,7 @@ where
1267
1267
///
1268
1268
/// # Examples
1269
1269
///
1270
- /// ```rust,ignore
1270
+ /// ```rust
1271
1271
/// # #![feature(allocator_api)]
1272
1272
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1273
1273
/// # use pin_init::*;
@@ -1343,7 +1343,7 @@ pub trait InPlaceWrite<T> {
1343
1343
///
1344
1344
/// Use [`pinned_drop`] to implement this trait safely:
1345
1345
///
1346
- /// ```rust,ignore
1346
+ /// ```rust
1347
1347
/// # #![feature(allocator_api)]
1348
1348
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1349
1349
/// # use pin_init::*;
0 commit comments