Skip to content

Commit 1ab1010

Browse files
y86-devojeda
authored andcommitted
rust: pin-init: re-enable doctests
The pin-init crate is now compiled in a standalone fashion, so revert the earlier commit that disabled the doctests in pin-init in order to avoid build errors while transitioning the crate into a standalone version. Signed-off-by: Benno Lossin <[email protected]> Reviewed-by: Fiona Behrens <[email protected]> Reviewed-by: Andreas Hindborg <[email protected]> Tested-by: Andreas Hindborg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 2e5f4f3 commit 1ab1010

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

rust/pin-init/src/lib.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
//! [`pin_init!`]. The syntax is almost the same as normal `struct` initializers. The difference is
6464
//! that you need to write `<-` instead of `:` for fields that you want to initialize in-place.
6565
//!
66-
//! ```rust,ignore
66+
//! ```rust
6767
//! # #![expect(clippy::disallowed_names)]
6868
//! # #![feature(allocator_api)]
6969
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
@@ -87,7 +87,7 @@
8787
//! `foo` now is of the type [`impl PinInit<Foo>`]. We can now use any smart pointer that we like
8888
//! (or just the stack) to actually initialize a `Foo`:
8989
//!
90-
//! ```rust,ignore
90+
//! ```rust
9191
//! # #![expect(clippy::disallowed_names)]
9292
//! # #![feature(allocator_api)]
9393
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
@@ -115,7 +115,7 @@
115115
//! Many types that use this library supply a function/macro that returns an initializer, because
116116
//! the above method only works for types where you can access the fields.
117117
//!
118-
//! ```rust,ignore
118+
//! ```rust
119119
//! # #![feature(allocator_api)]
120120
//! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
121121
//! # use pin_init::*;
@@ -126,7 +126,7 @@
126126
//!
127127
//! To declare an init macro/function you just return an [`impl PinInit<T, E>`]:
128128
//!
129-
//! ```rust,ignore
129+
//! ```rust
130130
//! # #![feature(allocator_api)]
131131
//! # use pin_init::*;
132132
//! # #[path = "../examples/error.rs"] mod error; use error::Error;
@@ -162,7 +162,7 @@
162162
//! - you may assume that `slot` will stay pinned even after the closure returns until `drop` of
163163
//! `slot` gets called.
164164
//!
165-
//! ```rust,ignore
165+
//! ```rust
166166
//! # #![feature(extern_types)]
167167
//! use pin_init::{pin_data, pinned_drop, PinInit, PinnedDrop, pin_init_from_closure};
168168
//! use core::{
@@ -306,7 +306,7 @@ pub use alloc::InPlaceInit;
306306
///
307307
/// # Examples
308308
///
309-
/// ```ignore
309+
/// ```
310310
/// # #![feature(allocator_api)]
311311
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
312312
/// use pin_init::pin_data;
@@ -323,7 +323,7 @@ pub use alloc::InPlaceInit;
323323
/// }
324324
/// ```
325325
///
326-
/// ```ignore
326+
/// ```
327327
/// # #![feature(allocator_api)]
328328
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
329329
/// # mod bindings { pub struct info; pub unsafe fn destroy_info(_: *mut info) {} }
@@ -357,7 +357,7 @@ pub use ::pin_init_internal::pin_data;
357357
///
358358
/// # Examples
359359
///
360-
/// ```ignore
360+
/// ```
361361
/// # #![feature(allocator_api)]
362362
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
363363
/// # mod bindings { pub struct info; pub unsafe fn destroy_info(_: *mut info) {} }
@@ -391,7 +391,7 @@ pub use ::pin_init_internal::pinned_drop;
391391
///
392392
/// # Examples
393393
///
394-
/// ```ignore
394+
/// ```
395395
/// use pin_init::Zeroable;
396396
///
397397
/// #[derive(Zeroable)]
@@ -407,7 +407,7 @@ pub use ::pin_init_internal::Zeroable;
407407
///
408408
/// # Examples
409409
///
410-
/// ```rust,ignore
410+
/// ```rust
411411
/// # #![expect(clippy::disallowed_names)]
412412
/// # #![feature(allocator_api)]
413413
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
@@ -459,7 +459,7 @@ macro_rules! stack_pin_init {
459459
///
460460
/// # Examples
461461
///
462-
/// ```rust,ignore
462+
/// ```rust
463463
/// # #![expect(clippy::disallowed_names)]
464464
/// # #![feature(allocator_api)]
465465
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
@@ -486,7 +486,7 @@ macro_rules! stack_pin_init {
486486
/// println!("a: {}", &*foo.a.lock());
487487
/// ```
488488
///
489-
/// ```rust,ignore
489+
/// ```rust
490490
/// # #![expect(clippy::disallowed_names)]
491491
/// # #![feature(allocator_api)]
492492
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
@@ -539,7 +539,7 @@ macro_rules! stack_try_pin_init {
539539
///
540540
/// The syntax is almost identical to that of a normal `struct` initializer:
541541
///
542-
/// ```rust,ignore
542+
/// ```rust
543543
/// # use pin_init::*;
544544
/// # use core::pin::Pin;
545545
/// #[pin_data]
@@ -583,7 +583,7 @@ macro_rules! stack_try_pin_init {
583583
///
584584
/// To create an initializer function, simply declare it like this:
585585
///
586-
/// ```rust,ignore
586+
/// ```rust
587587
/// # use pin_init::*;
588588
/// # use core::pin::Pin;
589589
/// # #[pin_data]
@@ -609,7 +609,7 @@ macro_rules! stack_try_pin_init {
609609
///
610610
/// Users of `Foo` can now create it like this:
611611
///
612-
/// ```rust,ignore
612+
/// ```rust
613613
/// # #![expect(clippy::disallowed_names)]
614614
/// # use pin_init::*;
615615
/// # use core::pin::Pin;
@@ -637,7 +637,7 @@ macro_rules! stack_try_pin_init {
637637
///
638638
/// They can also easily embed it into their own `struct`s:
639639
///
640-
/// ```rust,ignore
640+
/// ```rust
641641
/// # use pin_init::*;
642642
/// # use core::pin::Pin;
643643
/// # #[pin_data]
@@ -696,7 +696,7 @@ macro_rules! stack_try_pin_init {
696696
///
697697
/// For instance:
698698
///
699-
/// ```rust,ignore
699+
/// ```rust
700700
/// # use pin_init::*;
701701
/// # use core::{ptr::addr_of_mut, marker::PhantomPinned};
702702
/// #[pin_data]
@@ -750,7 +750,7 @@ macro_rules! pin_init {
750750
///
751751
/// # Examples
752752
///
753-
/// ```rust,ignore
753+
/// ```rust
754754
/// # #![feature(allocator_api)]
755755
/// # #[path = "../examples/error.rs"] mod error; use error::Error;
756756
/// use pin_init::{pin_data, try_pin_init, PinInit, InPlaceInit, zeroed};
@@ -857,7 +857,7 @@ macro_rules! init {
857857
///
858858
/// # Examples
859859
///
860-
/// ```rust,ignore
860+
/// ```rust
861861
/// # #![feature(allocator_api)]
862862
/// # use core::alloc::AllocError;
863863
/// # use pin_init::InPlaceInit;
@@ -904,7 +904,7 @@ macro_rules! try_init {
904904
/// # Example
905905
///
906906
/// This will succeed:
907-
/// ```ignore
907+
/// ```
908908
/// use pin_init::{pin_data, assert_pinned};
909909
///
910910
/// #[pin_data]
@@ -917,7 +917,7 @@ macro_rules! try_init {
917917
/// ```
918918
///
919919
/// This will fail:
920-
/// ```compile_fail,ignore
920+
/// ```compile_fail
921921
/// use pin_init::{pin_data, assert_pinned};
922922
///
923923
/// #[pin_data]
@@ -931,7 +931,7 @@ macro_rules! try_init {
931931
/// Some uses of the macro may trigger the `can't use generic parameters from outer item` error. To
932932
/// work around this, you may pass the `inline` parameter to the macro. The `inline` parameter can
933933
/// only be used when the macro is invoked from a function body.
934-
/// ```ignore
934+
/// ```
935935
/// # use core::pin::Pin;
936936
/// use pin_init::{pin_data, assert_pinned};
937937
///
@@ -1018,7 +1018,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
10181018
///
10191019
/// # Examples
10201020
///
1021-
/// ```rust,ignore
1021+
/// ```rust
10221022
/// # #![feature(allocator_api)]
10231023
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
10241024
/// # use pin_init::*;
@@ -1116,7 +1116,7 @@ pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
11161116
///
11171117
/// # Examples
11181118
///
1119-
/// ```rust,ignore
1119+
/// ```rust
11201120
/// # #![expect(clippy::disallowed_names)]
11211121
/// use pin_init::{init, zeroed, Init};
11221122
///
@@ -1229,7 +1229,7 @@ pub fn uninit<T, E>() -> impl Init<MaybeUninit<T>, E> {
12291229
///
12301230
/// # Examples
12311231
///
1232-
/// ```rust,ignore
1232+
/// ```rust
12331233
/// # use pin_init::*;
12341234
/// use pin_init::init_array_from_fn;
12351235
/// let array: Box<[usize; 1_000]> = Box::init(init_array_from_fn(|i| i)).unwrap();
@@ -1267,7 +1267,7 @@ where
12671267
///
12681268
/// # Examples
12691269
///
1270-
/// ```rust,ignore
1270+
/// ```rust
12711271
/// # #![feature(allocator_api)]
12721272
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
12731273
/// # use pin_init::*;
@@ -1343,7 +1343,7 @@ pub trait InPlaceWrite<T> {
13431343
///
13441344
/// Use [`pinned_drop`] to implement this trait safely:
13451345
///
1346-
/// ```rust,ignore
1346+
/// ```rust
13471347
/// # #![feature(allocator_api)]
13481348
/// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
13491349
/// # use pin_init::*;

0 commit comments

Comments
 (0)