@@ -73,6 +73,7 @@ mod std_vendor;
73
73
/// assert_eq!(cloned.b, 20);
74
74
///
75
75
/// // The refcount drops to zero when `cloned` goes out of scope, and the memory is freed.
76
+ /// # Ok::<(), Error>(())
76
77
/// ```
77
78
///
78
79
/// Using `Arc<T>` as the type of `self`:
@@ -98,6 +99,7 @@ mod std_vendor;
98
99
/// let obj = Arc::try_new(Example { a: 10, b: 20 })?;
99
100
/// obj.use_reference();
100
101
/// obj.take_over();
102
+ /// # Ok::<(), Error>(())
101
103
/// ```
102
104
///
103
105
/// Coercion from `Arc<Example>` to `Arc<dyn MyTrait>`:
@@ -121,6 +123,7 @@ mod std_vendor;
121
123
///
122
124
/// // `coerced` has type `Arc<dyn MyTrait>`.
123
125
/// let coerced: Arc<dyn MyTrait> = obj;
126
+ /// # Ok::<(), Error>(())
124
127
/// ```
125
128
pub struct Arc < T : ?Sized > {
126
129
ptr : NonNull < ArcInner < T > > ,
@@ -336,7 +339,7 @@ impl<T: ?Sized> From<Pin<UniqueArc<T>>> for Arc<T> {
336
339
/// # Example
337
340
///
338
341
/// ```
339
- /// use crate ::sync::{Arc, ArcBorrow};
342
+ /// use kernel ::sync::{Arc, ArcBorrow};
340
343
///
341
344
/// struct Example;
342
345
///
@@ -349,12 +352,13 @@ impl<T: ?Sized> From<Pin<UniqueArc<T>>> for Arc<T> {
349
352
///
350
353
/// // Assert that both `obj` and `cloned` point to the same underlying object.
351
354
/// assert!(core::ptr::eq(&*obj, &*cloned));
355
+ /// # Ok::<(), Error>(())
352
356
/// ```
353
357
///
354
358
/// Using `ArcBorrow<T>` as the type of `self`:
355
359
///
356
360
/// ```
357
- /// use crate ::sync::{Arc, ArcBorrow};
361
+ /// use kernel ::sync::{Arc, ArcBorrow};
358
362
///
359
363
/// struct Example {
360
364
/// a: u32,
@@ -369,6 +373,7 @@ impl<T: ?Sized> From<Pin<UniqueArc<T>>> for Arc<T> {
369
373
///
370
374
/// let obj = Arc::try_new(Example { a: 10, b: 20 })?;
371
375
/// obj.as_arc_borrow().use_reference();
376
+ /// # Ok::<(), Error>(())
372
377
/// ```
373
378
pub struct ArcBorrow < ' a , T : ?Sized + ' a > {
374
379
inner : NonNull < ArcInner < T > > ,
0 commit comments