Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fc1e52a
Add tracking issue and unstable book page for `"vectorcall"` ABI
beetrees Apr 28, 2024
494cbd8
bootstrap: implement new feature `bootstrap-self-test`
onur-ozkan May 19, 2024
1dcf764
Item bounds can reference self projections and still be object safe
compiler-errors Mar 21, 2024
65dffc1
Change pedantically incorrect OnceCell/OnceLock wording
mqudsi May 24, 2024
a126c11
Reorder the TOC so that targets are put under their meta-group
Lokathor May 28, 2024
f646314
make the fact that arm-none-eabi is a group of targets the first thin…
Lokathor May 28, 2024
144adf6
update armv4t docs
Lokathor May 28, 2024
d8704b9
It's spelled "ARM", in all caps.
Lokathor May 28, 2024
bb1f5c3
delete the offending single space.
Lokathor May 28, 2024
94d4040
The modern styling is apparently to use Title Case for the chip/compa…
Lokathor May 31, 2024
5f0043a
Handle no values cfg with --print=check-cfg
Urgau May 31, 2024
f58bf91
Add missing tracking issue number for --print=check-cfg
Urgau May 31, 2024
b320ac7
Add a regression test for a former blanket impl synthesis ICE
fmease Jun 3, 2024
4576027
Remove stray "this"
tbu- Jun 3, 2024
273b990
Align Term methods with GenericArg methods
compiler-errors May 30, 2024
960aeed
Rollup merge of #122804 - compiler-errors:item-bounds-can-reference-s…
Noratrieb Jun 4, 2024
b70e78f
Rollup merge of #124486 - beetrees:vectorcall-tracking-issue, r=ehuss
Noratrieb Jun 4, 2024
7735809
Rollup merge of #125273 - onur-ozkan:bootstrap-self-test, r=albertlar…
Noratrieb Jun 4, 2024
d65a179
Rollup merge of #125504 - mqudsi:once_nominal, r=cuviper
Noratrieb Jun 4, 2024
f0ddb4b
Rollup merge of #125690 - Lokathor:arm-maintainer-reorg, r=ehuss
Noratrieb Jun 4, 2024
5b9bf8d
Rollup merge of #125750 - compiler-errors:expect, r=lcnr
Noratrieb Jun 4, 2024
7506409
Rollup merge of #125818 - Urgau:print-check-cfg-no-values, r=petroche…
Noratrieb Jun 4, 2024
5e26f6a
Rollup merge of #125909 - fmease:rustdoc-add-test-synth-blanket-impls…
Noratrieb Jun 4, 2024
292985b
Rollup merge of #125919 - tbu-:pr_fix_typo, r=lqd
Noratrieb Jun 4, 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
Change pedantically incorrect OnceCell/OnceLock wording
While the semantic intent of a OnceCell/OnceLock is that it can only be written
to once (upon init), the fact of the matter is that both these types offer a
`take(&mut self) -> Option<T>` mechanism that, when successful, resets the cell
to its initial state, thereby technically allowing it to be written to again.

Despite the fact that this can only happen with a mutable reference (generally
only used during the construction of the OnceCell/OnceLock), it would be
incorrect to say that the type itself as a whole categorically prevents being
initialized or written to more than once (since it is possible to imagine an
identical type only without the `take()` method that actually fulfills that
contract).

To clarify, change "that cannot be.." to "that nominally cannot.." and add a
note to OnceCell about what can be done with an `&mut Self` reference.
  • Loading branch information
mqudsi committed May 24, 2024
commit 65dffc1990f91b470f23175ef243bdd5e0b5313a
4 changes: 2 additions & 2 deletions library/core/src/cell/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use crate::cell::UnsafeCell;
use crate::fmt;
use crate::mem;

/// A cell which can be written to only once.
/// A cell which can nominally be written to only once.
///
/// This allows obtaining a shared `&T` reference to its inner value without copying or replacing
/// it (unlike [`Cell`]), and without runtime borrow checks (unlike [`RefCell`]). However,
/// only immutable references can be obtained unless one has a mutable reference to the cell
/// itself.
/// itself. In the same vein, the cell can only be re-initialized with such a mutable reference.
///
/// For a thread-safe version of this struct, see [`std::sync::OnceLock`].
///
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/once_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::mem::MaybeUninit;
use crate::panic::{RefUnwindSafe, UnwindSafe};
use crate::sync::Once;

/// A synchronization primitive which can be written to only once.
/// A synchronization primitive which can nominally be written to only once.
///
/// This type is a thread-safe [`OnceCell`], and can be used in statics.
///
Expand Down