Skip to content

Updated std doctests for wasm #141065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/core/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ pub const unsafe fn assert_unchecked(cond: bool) {
///
/// # Examples
///
/// ```
/// ```ignore-wasm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I didn't know we supported ignore-wasm syntax in doctests... I'm not sure if we have any docs for the strings here, but seems like we should maybe add them to https://doc.rust-lang.org/rustdoc/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// use std::sync::atomic::{AtomicBool, Ordering};
/// use std::sync::Arc;
/// use std::{hint, thread};
Expand Down
14 changes: 7 additions & 7 deletions library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
//!
//! A simple spinlock:
//!
//! ```
//! ```ignore-wasm
//! use std::sync::Arc;
//! use std::sync::atomic::{AtomicUsize, Ordering};
//! use std::{hint, thread};
Expand Down Expand Up @@ -622,7 +622,7 @@ impl AtomicBool {
///
/// # Examples
///
/// ```
/// ```ignore-wasm
/// #![feature(atomic_from_mut)]
/// use std::sync::atomic::{AtomicBool, Ordering};
///
Expand Down Expand Up @@ -653,7 +653,7 @@ impl AtomicBool {
///
/// # Examples
///
/// ```
/// ```rust,ignore-wasm
/// #![feature(atomic_from_mut)]
/// use std::sync::atomic::{AtomicBool, Ordering};
///
Expand Down Expand Up @@ -1548,7 +1548,7 @@ impl<T> AtomicPtr<T> {
///
/// # Examples
///
/// ```
/// ```ignore-wasm
/// #![feature(atomic_from_mut)]
/// use std::ptr::null_mut;
/// use std::sync::atomic::{AtomicPtr, Ordering};
Expand Down Expand Up @@ -1585,7 +1585,7 @@ impl<T> AtomicPtr<T> {
///
/// # Examples
///
/// ```
/// ```ignore-wasm
/// #![feature(atomic_from_mut)]
/// use std::ptr::null_mut;
/// use std::sync::atomic::{AtomicPtr, Ordering};
Expand Down Expand Up @@ -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};")]
///
Expand Down Expand Up @@ -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};")]
///
Expand Down
Loading