From db950fa77f67ca548526cb3a5b5fbbaaa53e6e3f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 15 May 2025 19:59:22 -0700 Subject: [PATCH] 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. --- library/core/src/hint.rs | 2 +- library/core/src/sync/atomic.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 6eefb30468931..8ea9de7e9e52e 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -231,7 +231,7 @@ pub const unsafe fn assert_unchecked(cond: bool) { /// /// # Examples /// -/// ``` +/// ```ignore-wasm /// use std::sync::atomic::{AtomicBool, Ordering}; /// use std::sync::Arc; /// use std::{hint, thread}; diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index 84c7f1aafe1b0..bd5a58d74ba0d 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -193,7 +193,7 @@ //! //! A simple spinlock: //! -//! ``` +//! ```ignore-wasm //! use std::sync::Arc; //! use std::sync::atomic::{AtomicUsize, Ordering}; //! use std::{hint, thread}; @@ -622,7 +622,7 @@ impl AtomicBool { /// /// # Examples /// - /// ``` + /// ```ignore-wasm /// #![feature(atomic_from_mut)] /// use std::sync::atomic::{AtomicBool, Ordering}; /// @@ -653,7 +653,7 @@ impl AtomicBool { /// /// # Examples /// - /// ``` + /// ```rust,ignore-wasm /// #![feature(atomic_from_mut)] /// use std::sync::atomic::{AtomicBool, Ordering}; /// @@ -1548,7 +1548,7 @@ impl AtomicPtr { /// /// # Examples /// - /// ``` + /// ```ignore-wasm /// #![feature(atomic_from_mut)] /// use std::ptr::null_mut; /// use std::sync::atomic::{AtomicPtr, Ordering}; @@ -1585,7 +1585,7 @@ impl AtomicPtr { /// /// # Examples /// - /// ``` + /// ```ignore-wasm /// #![feature(atomic_from_mut)] /// use std::ptr::null_mut; /// use std::sync::atomic::{AtomicPtr, Ordering}; @@ -2692,7 +2692,7 @@ macro_rules! atomic_int { /// /// # Examples /// - /// ``` + /// ```ignore-wasm /// #![feature(atomic_from_mut)] #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] /// @@ -2725,7 +2725,7 @@ macro_rules! atomic_int { /// /// # Examples /// - /// ``` + /// ```ignore-wasm /// #![feature(atomic_from_mut)] #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] ///