rust/library/core/src
Samuel Tardieu 1724af9f1e
Rollup merge of #144872 - connortsui20:once-poison-docs, r=Amanieu
Document Poisoning in `LazyCell` and `LazyLock`

Currently, there is no documentation of poisoning behavior in either `LazyCell` or `LazyLock`, even though both of them can be observed as poisoned by users.

`LazyCell` [plagyround example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=9cf38b8dc56db100848f54085c2c697d)

`LazyLock` [playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=f1cd6f9fe16636e347ebb695a0ce30c0)

# Open Questions

- [x] Is it worth making the implementation of `LazyLock` more complicated to ensure that the the panic message is `"LazyLock instance has previously been poisoned"` instead of `"Once instance has previously been poisoned"`? See the `LazyLock` playground link above for more context.
- [x] Does it make sense to move `LazyLock` into the `poison` module? It is certainly a poison-able type, but at the same time it is slightly different from the 4 other types currently in the `poison` module in that it is unrecoverable. I think this is more of a libs-api question.

``@rustbot`` label +T-libs-api

Please let me know if these open questions deserve a separate issue / PR!
2025-08-05 03:51:38 +02:00
..
alloc clippy fix: indentation 2025-07-04 11:52:17 +00:00
array Use as_array in PartialEq for arrays 2025-08-03 12:47:11 -07:00
ascii Constify Try, From, TryFrom 2025-07-21 12:49:45 +03:00
async_iter clippy fix: markdown indentation for indented items after line break 2025-07-08 11:48:15 +00:00
bstr Replace colon with parentheses, add missing period 2025-04-21 10:48:46 -04:00
cell add poisoning documentation to LazyCell 2025-08-03 22:57:07 +02:00
char Constify Try, From, TryFrom 2025-07-21 12:49:45 +03:00
clone CloneToUninit: use a private specialization trait 2024-07-29 20:44:43 +03:00
cmp Make slices [const] PartialEq 2025-07-17 17:58:10 +00:00
convert Constify Try, From, TryFrom 2025-07-21 12:49:45 +03:00
ffi Rollup merge of #143326 - hkBst:rm-deprecated-1, r=jhpratt 2025-07-17 10:41:43 +02:00
fmt Rollup merge of #143423 - hkBst:clippy-fix-1, r=workingjubilee 2025-07-20 15:34:04 +02:00
future Address documentation issues identified with Future 2025-06-07 20:13:54 +01:00
hash Remove some unsized tuple impls now that we don't support unsizing tuples anymore 2025-07-02 14:17:54 +00:00
intrinsics Add #[rustc_intrinsic_const_stable_indirect] to float rounding 2025-07-20 00:09:32 +04:00
io Rollup merge of #143829 - a1phyr:trim_borrowed_buf, r=ChrisDenton 2025-07-17 03:58:32 +02:00
iter Rollup merge of #144478 - joshtriplett:doc-code-formatting-prep, r=Amanieu 2025-08-02 11:24:24 +02:00
macros Rollup merge of #144478 - joshtriplett:doc-code-formatting-prep, r=Amanieu 2025-08-02 11:24:24 +02:00
marker phantom_variance_markers: fix identifier usage in macro 2025-06-22 16:06:25 -07:00
mem Rollup merge of #144478 - joshtriplett:doc-code-formatting-prep, r=Amanieu 2025-08-02 11:24:24 +02:00
net Rollup merge of #143768 - Randl:const-try, r=oli-obk 2025-07-22 00:54:26 +08:00
num Fix safety comment for new_unchecked in niche_types 2025-08-01 14:00:56 -07:00
ops Rollup merge of #144167 - zachs18:rangebounds-not-unsized-reason, r=tgross35 2025-07-29 20:19:48 +10:00
panic Fix Ord, Eq and Hash implementation of panic::Location 2025-07-29 22:15:44 +02:00
pin Remove PointerLike trait 2025-07-03 20:03:49 +00:00
prelude Make derive_const usable within libcore again 2025-07-17 15:42:54 +00:00
ptr AlignmentEnum should just be repr(usize) now 2025-07-30 00:09:01 -07:00
range Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
slice Rollup merge of #142205 - paolobarbolini:const_swap_with_slice-impl, r=Mark-Simulacrum 2025-08-04 11:24:35 +10:00
str Auto merge of #144393 - heiher:str-contains-lsx, r=tgross35 2025-07-29 20:44:32 +00:00
sync fix Atomic*::as_ptr wording 2025-07-28 20:41:24 +08:00
task Rollup merge of #142158 - xizheyin:141617, r=jdonszelmann 2025-06-13 05:16:56 +02:00
unicode Remove uncessary parens in closure body with unused lint 2025-07-10 09:25:56 +08:00
any.rs interpret: fix TypeId pointers being considered data pointers 2025-07-19 10:29:13 +02:00
arch.rs update version placeholders 2025-05-12 15:33:30 +02:00
ascii.rs add doc(alias("AsciiChar")) to core::ascii::Char 2025-06-20 11:11:51 -05:00
asserting.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
bool.rs Add methods for converting bool to Result<(), E> 2025-06-19 23:20:06 +02:00
borrow.rs clippy fix: rely on autoderef 2025-07-04 11:35:00 +00:00
cell.rs Improve and regularize comment placement in doc code 2025-07-25 22:02:09 -07:00
clone.rs clippy fix: rely on autoderef 2025-07-04 11:35:00 +00:00
cmp.rs Rollup merge of #143423 - hkBst:clippy-fix-1, r=workingjubilee 2025-07-20 15:34:04 +02:00
contracts.rs Apply suggestions from code review 2025-04-10 16:32:56 -07:00
default.rs update issue number for const_trait_impl 2025-07-13 23:55:06 +08:00
error.md Mention core's PanicInfo in error.md. 2024-06-11 15:47:00 +02:00
error.rs clippy fix: indentation 2025-07-04 11:52:17 +00:00
escape.rs Get rid of EscapeDebugInner. 2025-06-15 22:08:41 +02:00
hint.rs Improve and regularize comment placement in doc code 2025-07-25 22:02:09 -07:00
internal_macros.rs Use cfg_match in core 2025-03-26 14:32:35 -04:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Rollup merge of #143423 - hkBst:clippy-fix-1, r=workingjubilee 2025-07-20 15:34:04 +02:00
marker.rs Improve and regularize comment placement in doc code 2025-07-25 22:02:09 -07:00
option.rs Rollup merge of #143768 - Randl:const-try, r=oli-obk 2025-07-22 00:54:26 +08:00
panic.rs update cfgs 2024-11-27 15:14:54 +00:00
panicking.rs Insert checks for enum discriminants when debug assertions are enabled 2025-06-27 09:37:36 +00:00
pat.rs update cfgs 2025-04-09 12:29:59 +01:00
pin.rs clippy fix: indentation 2025-07-04 11:52:17 +00:00
primitive.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
primitive_docs.rs Avoid placing // FIXME comments inside doc code blocks 2025-07-25 22:02:09 -07:00
random.rs random: Provide a Distribution<T> trait 2025-07-11 10:21:34 -07:00
range.rs Document (internally) that Range*<&T> as RangeBounds<T> impls are intentionally not T: ?Sized, and document (publically) an alternative. 2025-07-23 15:39:03 -05:00
result.rs Rollup merge of #144478 - joshtriplett:doc-code-formatting-prep, r=Amanieu 2025-08-02 11:24:24 +02:00
time.rs Split duration_constructors to get non-controversial bits out faster. 2025-05-09 22:52:39 -04:00
tuple.rs random: Provide a Distribution<T> trait 2025-07-11 10:21:34 -07:00
ub_checks.rs fix: don't panic on volatile access to null 2025-07-18 13:41:34 -03:00
unit.rs core: Make Debug impl of raw pointers print metadata if present 2025-02-15 17:27:55 +01:00
unsafe_binder.rs Add unwrap_unsafe_binder and wrap_unsafe_binder macro operators 2024-12-12 16:29:40 +00:00