8000 Rollup of 13 pull requests by Centril · Pull Request #65368 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 13 pull requests #65368

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 33 commits into from
Oct 13, 2019
Merged
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
334bafe
Document current deny by default lints
197g Oct 3, 2019
4bb1592
Suggest `if let` on `let` refutable binding
estebank Oct 9, 2019
5bb0a03
Move diagnostics code out of the critical path
estebank Oct 11, 2019
91cf02c
Implement Clone::clone_from for VecDeque
crgl Oct 3, 2019
10671f1
Add tests for VecDeque clone_from
crgl Oct 3, 2019
d21eeb1
Override nth for VecDeque Iter and IterMut
crgl Oct 4, 2019
7140c02
resolve: fix error title regarding private constructors
da-x Oct 11, 2019
9d11bda
resolve: shorten wording on private constructor error
da-x Oct 11, 2019
05db5a2
Report lint in external macros
memoryruins Oct 11, 2019
95a65cd
Add regression test for CONST_ERR lints in extern macros
memoryruins Oct 11, 2019
e039534
replace the hand-written binary search with the library one
Oct 12, 2019
d8c2956
Improve docs on some char boolean methods
Oct 6, 2019
a2b2362
do not reference LLVM for our concurrency memory model
RalfJung Oct 12, 2019
63cb2fa
compress the function, remove the assert check.
Oct 12, 2019
f363550
it's C++20
RalfJung Oct 12, 2019
d6ab45d
fix link targets
RalfJung Oct 12, 2019
9f09387
syntax: simplify maybe_annotate_with_ascription
Centril Oct 8, 2019
477a68b
simplify maybe_stage_features
Centril Oct 8, 2019
7effe63
simplify integer_lit
Centril Oct 8, 2019
94db37a
mbe: reduce panictry! uses.
Centril Oct 8, 2019
d0f8bd6
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=Guillau…
Centril Oct 13, 2019
4dc0b8a
Rollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss
Centril Oct 13, 2019
82fb193
Rollup merge of #65165 - BO41:char_docs, r=varkor
Centril Oct 13, 2019
963e4bc
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj
Centril Oct 13, 2019
540278c
Rollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov
Centril Oct 13, 2019
433ea1a
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Centril Oct 13, 2019
643261a
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk
Centril Oct 13, 2019
af8a6e5
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petroch…
Centril Oct 13, 2019
293d02d
Rollup merge of #65339 - RalfJung:atomic-ordering, r=Centril
Centril Oct 13, 2019
b143aa2
Rollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascript…
Centril Oct 13, 2019
5af528a
Rollup merge of #65358 - Centril:smsf, r=davidtwco
Centril Oct 13, 2019
af54a3e
Rollup merge of #65359 - Centril:sil, r=davidtwco
Centril Oct 13, 2019
b828591
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov
Centril Oct 13, 2019
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
52 changes: 27 additions & 25 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
//!
//! Each method takes an [`Ordering`] which represents the strength of
//! the memory barrier for that operation. These orderings are the
//! same as [LLVM atomic orderings][1]. For more information see the [nomicon][2].
//! same as the [C++20 atomic orderings][1]. For more information see the [nomicon][2].
//!
//! [`Ordering`]: enum.Ordering.html
//!
//! [1]: https://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations
//! [1]: https://en.cppreference.com/w/cpp/atomic/memory_order
//! [2]: ../../../nomicon/atomics.html
//!
//! Atomic variables are safe to share between threads (they implement [`Sync`])
Expand Down Expand Up @@ -217,8 +217,8 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
/// operations synchronize other memory while additionally preserving a total order of such
/// operations across all threads.
///
/// Rust's memory orderings are [the same as
/// LLVM's](https://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations).
/// Rust's memory orderings are [the same as those of
/// C++20](https://en.cppreference.com/w/cpp/atomic/memory_order).
///
/// For more information see the [nomicon].
///
Expand All @@ -231,9 +231,9 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
pub enum Ordering {
/// No ordering constraints, only atomic operations.
///
/// Corresponds to LLVM's [`Monotonic`] ordering.
/// Corresponds to [`memory_order_relaxed`] in C++20.
///
/// [`Monotonic`]: https://llvm.org/docs/Atomics.html#monotonic
/// [`memory_order_relaxed`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Relaxed_ordering
#[stable(feature = "rust1", since = "1.0.0")]
Relaxed,
/// When coupled with a store, all previous operations become ordered
Expand All @@ -246,11 +246,12 @@ pub enum Ordering {
///
/// This ordering is only applicable for operations that can perform a store.
///
/// Corresponds to LLVM's [`Release`] ordering.
/// Corresponds to [`memory_order_release`] in C++20.
///
/// [`Release`]: https://llvm.org/docs/Atomics.html#release
/// [`Acquire`]: https://llvm.org/docs/Atomics.html#acquire
/// [`Relaxed`]: https://llvm.org/docs/Atomics.html#monotonic
/// [`Release`]: #variant.Release
/// [`Acquire`]: #variant.Acquire
/// [`Relaxed`]: #variant.Relaxed
/// [`memory_order_release`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
#[stable(feature = "rust1", since = "1.0.0")]
Release,
/// When coupled with a load, if the loaded value was written by a store operation with
Expand All @@ -263,40 +264,41 @@ pub enum Ordering {
///
/// This ordering is only applicable for operations that can perform a load.
///
/// Corresponds to LLVM's [`Acquire`] ordering.
/// Corresponds to [`memory_order_acquire`] in C++20.
///
/// [`Acquire`]: https://llvm.org/docs/Atomics.html#acquire
/// [`Release`]: https://llvm.org/docs/Atomics.html#release
/// [`Relaxed`]: https://llvm.org/docs/Atomics.html#monotonic
/// [`Acquire`]: #variant.Acquire
/// [`Release`]: #variant.Release
/// [`Relaxed`]: #variant.Relaxed
/// [`memory_order_acquire`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
#[stable(feature = "rust1", since = "1.0.0")]
Acquire,
/// Has the effects of both [`Acquire`] and [`Release`] together:
/// For loads it uses [`Acquire`] ordering. For stores it uses the [`Release`] ordering.
///
/// Notice that in the case of `compare_and_swap`, it is possible that the operation ends up
/// not performing any store and hence it has just [`Acquire`] ordering. However,
/// [`AcqRel`][`AcquireRelease`] will never perform [`Relaxed`] accesses.
/// `AcqRel` will never perform [`Relaxed`] accesses.
///
/// This ordering is only applicable for operations that combine both loads and stores.
///
/// Corresponds to LLVM's [`AcquireRelease`] ordering.
/// Corresponds to [`memory_order_acq_rel`] in C++20.
///
/// [`AcquireRelease`]: https://llvm.org/docs/Atomics.html#acquirerelease
/// [`Acquire`]: https://llvm.org/docs/Atomics.html#acquire
/// [`Release`]: https://llvm.org/docs/Atomics.html#release
/// [`Relaxed`]: https://llvm.org/docs/Atomics.html#monotonic
/// [`memory_order_acq_rel`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
/// [`Acquire`]: #variant.Acquire
/// [`Release`]: #variant.Release
/// [`Relaxed`]: #variant.Relaxed
#[stable(feature = "rust1", since = "1.0.0")]
AcqRel,
/// Like [`Acquire`]/[`Release`]/[`AcqRel`] (for load, store, and load-with-store
/// operations, respectively) with the additional guarantee that all threads see all
/// sequentially consistent operations in the same order.
///
/// Corresponds to LLVM's [`SequentiallyConsistent`] ordering.
/// Corresponds to [`memory_order_seq_cst`] in C++20.
///
/// [`SequentiallyConsistent`]: https://llvm.org/docs/Atomics.html#sequentiallyconsistent
/// [`Acquire`]: https://llvm.org/docs/Atomics.html#acquire
/// [`Release`]: https://llvm.org/docs/Atomics.html#release
/// [`AcqRel`]: https://llvm.org/docs/Atomics.html#acquirerelease
/// [`memory_order_seq_cst`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Sequentially-consistent_ordering
/// [`Acquire`]: #variant.Acquire
/// [`Release`]: #variant.Release
/// [`AcqRel`]: #variant.AcqRel
#[stable(feature = "rust1", since = "1.0.0")]
SeqCst,
}
Expand Down
0