Skip to content
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

Add atomic module to alloc::sync #58175

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 20 additions & 1 deletion src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! [arc]: struct.Arc.html
use core::any::Any;
use core::sync::atomic;
use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
use core::borrow;
use core::fmt;
Expand All @@ -29,6 +28,26 @@ use crate::rc::is_dangling;
use crate::string::String;
use crate::vec::Vec;

// Since the current `liballoc` is not a superset of `libcore`,
// using `pub use core::sync::atomic;` will fail with some link errors.
// If `liballoc` becomes a superset of `libcore`, replace this with
// `pub use core::sync::atomic;`.
Copy link
Member Author

Choose a reason for hiding this comment

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

I added a description.

Copy link
Member Author

Choose a reason for hiding this comment

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

Specifically, it is this error: #58175 (comment)

[01:36:43] alloc/sync/atomic/index.html:13: broken link - alloc/marker/trait.Sync.html

/// Atomic types
///
/// Atomic types provide primitive shared-memory communication between
/// threads, and are the building blocks of other concurrent
/// types.
///
/// See [`std::sync::atomic`][atomic] for more details.
///
/// [atomic]: ../../../std/sync/atomic/index.html
#[stable(feature = "rust1", since = "1.0.0")]
pub mod atomic {
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(inline)]
pub use core::sync::atomic::*;
}

/// A soft limit on the amount of references that may be made to an `Arc`.
///
/// Going above this limit will abort your program (although not
Expand Down