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

Rollup of 10 pull requests #131775

Merged
merged 20 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f708d6d
Fix match_same_arms in stable_mir
practicalrs Oct 14, 2024
373142a
Mark LazyCell::into_inner unstably const
tgross35 Oct 14, 2024
5d178e1
Make fuchsia-test-runner.py compatible with new JSON output from llvm…
c6c7 Oct 14, 2024
937d13b
relax a memory order in `once_box`
slanterns Oct 15, 2024
6888521
Don't report bivariance error when nesting a struct with field errors…
compiler-errors Oct 15, 2024
e985396
llvm: Match aarch64 data layout to new LLVM layout
maurer Oct 15, 2024
4cf0475
Fix unnecessary nesting in run-make test output directories
Zalathar Oct 16, 2024
69faeaf
mailmap: add entry for my dev-desktop setup
jieyouxu Oct 16, 2024
0804d1b
Add wasm32-unknown-emscripten platform support document
juntyr Oct 12, 2024
5eb8636
Handle gracefully true/false in `cfg(target(..))` compact
Urgau Oct 16, 2024
f7b91ca
Rollup merge of #131582 - juntyr:emscripten-platform-support, r=jieyouxu
Urgau Oct 16, 2024
042ea4e
Rollup merge of #131694 - c6c7:fixup-failing-fuchsia-tests, r=Urgau
Urgau Oct 16, 2024
9c7d579
Rollup merge of #131700 - practicalrs:fix_match_same_arms, r=celinval
Urgau Oct 16, 2024
f7af3aa
Rollup merge of #131712 - tgross35:const-lazy_cell_into_inner, r=joboet
Urgau Oct 16, 2024
66dc09f
Rollup merge of #131746 - slanterns:once_box_order, r=joboet
Urgau Oct 16, 2024
329e570
Rollup merge of #131754 - compiler-errors:bivariance-bivariance, r=es…
Urgau Oct 16, 2024
6b27c30
Rollup merge of #131760 - maurer:data-layout-aarch64, r=nikic
Urgau Oct 16, 2024
43a142e
Rollup merge of #131764 - Zalathar:double-dir, r=jieyouxu
Urgau Oct 16, 2024
ea063a2
Rollup merge of #131766 - jieyouxu:mailmap, r=lqd
Urgau Oct 16, 2024
e0e1e35
Rollup merge of #131771 - Urgau:cfg-target-131759, r=jieyouxu
Urgau Oct 16, 2024
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
Prev Previous commit
Next Next commit
relax a memory order in once_box
  • Loading branch information
slanterns committed Oct 15, 2024
commit 937d13b8efc43f3f2e93f81360565d82f243ce15
4 changes: 2 additions & 2 deletions library/std/src/sys/sync/once_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use crate::mem::replace;
use crate::ptr::null_mut;
use crate::sync::atomic::AtomicPtr;
use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed};
use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};

pub(crate) struct OnceBox<T> {
ptr: AtomicPtr<T>,
Expand Down Expand Up @@ -60,7 +60,7 @@ impl<T> OnceBox<T> {
#[cold]
fn initialize(&self, f: impl FnOnce() -> Box<T>) -> &T {
let new_ptr = Box::into_raw(f());
match self.ptr.compare_exchange(null_mut(), new_ptr, AcqRel, Acquire) {
match self.ptr.compare_exchange(null_mut(), new_ptr, Release, Acquire) {
Ok(_) => unsafe { &*new_ptr },
Err(ptr) => {
// Lost the race to another thread.
Expand Down
Loading