Commit Graph

35 Commits

Author SHA1 Message Date
Mara Bos 7855a730b9 Rollup merge of #80966 - KodrAus:deprecate/spin_loop_hint, r=m-ou-se
Deprecate atomic::spin_loop_hint in favour of hint::spin_loop

For https://github.com/rust-lang/rust/issues/55002

We wanted to leave `atomic::spin_loop_hint` alone when stabilizing `hint::spin_loop` so folks had some time to migrate. This now deprecates `atomic_spin_loop_hint`.
2021-01-14 18:00:14 +00:00
Mark Rousskov 8a3edb1d66 Update tests for extern block linting 2021-01-13 07:49:16 -05:00
Ashley Mannix d65cb6ebce deprecate atomic::spin_loop_hint in favour of hint::spin_loop 2021-01-13 16:30:29 +10:00
Mara Bos 27b81bf97a Remove all doc_comment!{} hacks by using #[doc = expr] where needed. 2020-12-30 22:49:08 +01:00
Mark Rousskov fe031180d0 Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
Linus Färnstrand 3eef20ffa0 Improve documentation on success and failure arguments 2020-12-22 12:19:46 +01:00
Linus Färnstrand 7f35e2d573 Add doc aliases to compare_exchange[_weak] 2020-12-22 12:19:46 +01:00
Linus Färnstrand 4252e48256 Add documentation on migrating away from compare_and_swap 2020-12-22 12:17:43 +01:00
Linus Färnstrand 3abba5e21f Deprecate compare_and_swap on all atomic types 2020-12-22 12:17:43 +01:00
Tomasz Miąsko 4ad53dc9f5 Use pointer type in AtomicPtr::swap implementation 2020-12-20 00:00:00 +00:00
oli 392ea29757 Cast pointers to usize before passing them to atomic operations as some platforms do not support atomic operations on pointers. 2020-11-29 12:58:03 +00:00
oli aabe70f90e Directly use raw pointers in AtomicPtr store/load 2020-11-28 17:13:47 +00:00
James Munns 69477f50d8 Clarify availability of atomic operations
This was noticed while we were updating the embedded rust book: https://github.com/rust-embedded/book/pull/273/files

These targets do natively have atomic load/stores, but do not support CAS operations.
2020-11-17 01:38:53 +01:00
Mara Bos 2967e58be3 Rollup merge of #78728 - a1phyr:const_cell_into_inner, r=dtolnay
Constantify `UnsafeCell::into_inner` and related

Tracking issue: #78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? `````@dtolnay`````
2020-11-08 13:36:14 +01:00
Mara Bos 1f034f77bc Rollup merge of #76097 - pickfire:stabilize-spin-loop, r=KodrAus
Stabilize hint::spin_loop

Partially fix #55002, deprecate in another release

r? ``````@KodrAus``````
2020-11-08 13:35:54 +01:00
Ivan Tham e8b5be5dff Stabilize hint::spin_loop
Partially fix #55002, deprecate in another release

Co-authored-by: Ashley Mannix <kodraus@hey.com>

Update stable version for stabilize_spin_loop

Co-authored-by: Joshua Nelson <joshua@yottadb.com>

Use better example for spinlock

As suggested by KodrAus

Remove renamed_spin_loop already available in master

Fix spin loop example
2020-11-06 23:41:55 +08:00
Benoît du Garreau 795bbfe056 Add tracking issue 2020-11-04 11:58:41 +01:00
Benoît du Garreau 9a12d727df Constantify UnsafeCell::into_inner and related
Also includes:
- Cell::into_inner
- RefCell::into_inner
- Atomic*::into_inner
2020-11-04 11:41:57 +01:00
Vadim Petrochenkov 19dbb02a89 Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00
Nika Layzell 00f32e6631 Add fetch_update methods to AtomicBool and AtomicPtr
These methods were stabilized for the integer atomics in #71843, but the methods
were not added for the non-integer atomics `AtomicBool` and `AtomicPtr`.
2020-11-01 13:57:45 -05:00
Scott Olson e5b1f69d63 Inline Default::default() for atomics 2020-11-01 04:38:41 +00:00
Mara Bos 5d6f1a1e32 Move use align_of in atomic.rs into the places where it is used. 2020-09-21 20:44:45 +02:00
Mara Bos 7a04ff6c33 Gate Atomic::from_mut on cfg(target_has_atomic_equal_alignment).
Instead of a few hardcoded cfg(target_arch = ..) like before.
2020-09-21 20:43:44 +02:00
Mara Bos 668225d157 Revert "Revert adding Atomic::from_mut."
This reverts commit 5ef1db3622.
2020-09-21 20:43:44 +02:00
Ralf Jung b0c2eab66a Rollup merge of #76967 - fusion-engineering-forks:revert-atomic-from-mut, r=kodrAus
Revert adding Atomic::from_mut.

This reverts #74532, which made too many assumptions about platforms, breaking some things.

Will need to be added later with a better way of gating on proper alignment, without hardcoding cfg(target_arch)s.

---

To be merged if fixing from_mut (#76965) takes too long.

r? @ghost
2020-09-21 15:30:41 +02:00
Daniel Henry-Mantilla 5886c38112 Replace unneeded unsafe calls to .get() with calls to .get_mut() 2020-09-20 18:06:03 +02:00
Mara Bos 5ef1db3622 Revert adding Atomic::from_mut.
This made too many assumptions about platforms, breaking some things.

Will need to be added later with a better way of gating on proper
alignment, without hardcoding cfg(target_arch)s.
2020-09-20 12:54:37 +02:00
Mara Bos 9914c3beed Supress unused_macros error on architectures with no atomics. 2020-09-13 18:34:27 +02:00
Mara Bos 3be40b22c8 Fix AtomicPtr::from_mut align check: Avoid generic arg in const expr.
See #76200.
2020-09-13 14:09:10 +02:00
Mara Bos 458aaba084 Add Atomic*::from_mut.
The atomic equivalent of Cell::from_mut.
2020-09-13 14:08:52 +02:00
Alexis Bourget 6b75e3d11b Move to Arc::clone(&x) over x.clone() in library/core 2020-08-30 22:14:17 +02:00
Denis Vasilik c7571e6040 Use intra-doc links for bool 2020-08-28 17:30:05 +02:00
Denis Vasilik 4bbed52320 Use intra-doc links 2020-08-28 17:24:47 +02:00
Ralf Jung 897149a883 fence docs: fix example Mutex 2020-07-29 15:45:42 +02:00
mark 2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00