Skip to content

Commit db950fa

Browse files
committed
Updated std doctests for wasm
This updates some doctests that fail to run on wasm. We will soon be supporting cross-compiled doctests, and the test-various job fails to run these tests. These tests fail because wasm32-wasip1 does not support threads.
1 parent 6d1875f commit db950fa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

library/core/src/hint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub const unsafe fn assert_unchecked(cond: bool) {
231231
///
232232
/// # Examples
233233
///
234-
/// ```
234+
/// ```ignore-wasm
235235
/// use std::sync::atomic::{AtomicBool, Ordering};
236236
/// use std::sync::Arc;
237237
/// use std::{hint, thread};

library/core/src/sync/atomic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
//!
194194
//! A simple spinlock:
195195
//!
196-
//! ```
196+
//! ```ignore-wasm
197197
//! use std::sync::Arc;
198198
//! use std::sync::atomic::{AtomicUsize, Ordering};
199199
//! use std::{hint, thread};
@@ -622,7 +622,7 @@ impl AtomicBool {
622622
///
623623
/// # Examples
624624
///
625-
/// ```
625+
/// ```ignore-wasm
626626
/// #![feature(atomic_from_mut)]
627627
/// use std::sync::atomic::{AtomicBool, Ordering};
628628
///
@@ -653,7 +653,7 @@ impl AtomicBool {
653653
///
654654
/// # Examples
655655
///
656-
/// ```
656+
/// ```rust,ignore-wasm
657657
/// #![feature(atomic_from_mut)]
658658
/// use std::sync::atomic::{AtomicBool, Ordering};
659659
///
@@ -1548,7 +1548,7 @@ impl<T> AtomicPtr<T> {
15481548
///
15491549
/// # Examples
15501550
///
1551-
/// ```
1551+
/// ```ignore-wasm
15521552
/// #![feature(atomic_from_mut)]
15531553
/// use std::ptr::null_mut;
15541554
/// use std::sync::atomic::{AtomicPtr, Ordering};
@@ -1585,7 +1585,7 @@ impl<T> AtomicPtr<T> {
15851585
///
15861586
/// # Examples
15871587
///
1588-
/// ```
1588+
/// ```ignore-wasm
15891589
/// #![feature(atomic_from_mut)]
15901590
/// use std::ptr::null_mut;
15911591
/// use std::sync::atomic::{AtomicPtr, Ordering};
@@ -2692,7 +2692,7 @@ macro_rules! atomic_int {
26922692
///
26932693
/// # Examples
26942694
///
2695-
/// ```
2695+
/// ```ignore-wasm
26962696
/// #![feature(atomic_from_mut)]
26972697
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
26982698
///
@@ -2725,7 +2725,7 @@ macro_rules! atomic_int {
27252725
///
27262726
/// # Examples
27272727
///
2728-
/// ```
2728+
/// ```ignore-wasm
27292729
/// #![feature(atomic_from_mut)]
27302730
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
27312731
///

0 commit comments

Comments
 (0)