Ralf Jung
1827bc0f39
rename internal panicking::try to catch_unwind
2025-05-24 16:32:00 +02:00
Christopher Durham
4d93f60568
use generic Atomic type where possible
...
in core/alloc/std only for now, and ignoring test files
Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2025-04-27 02:18:08 +03:00
cyrgani
a72402a0f9
add last std diagnostic items for clippy
2025-02-18 10:54:37 +01:00
Eric Huss
7dc9e05742
std: Apply dependency_on_unit_never_type_fallback
...
This generates a warning of irrefutable patterns. I decided to slightly
tweak the example so the closure returns unit, since the intent wasn't
to show the weird behavior of returning `!`.
2025-02-13 13:10:27 -08:00
bjorn3
09c4dbf7fb
Move std::panic unit tests to integration tests
2025-01-26 10:28:04 +00:00
bors
9903b256a2
Auto merge of #128321 - BatmanAoD:catch-unwind-doc-update, r=Mark-Simulacrum
...
Update `catch_unwind` doc comments for `c_unwind`
Updates `catch_unwind` doc comments to indicate that catching a foreign exception _will no longer_ be UB. Instead, there are two possible behaviors, though it is not specified which one an implementation will choose.
Nominated for t-lang to confirm that they are okay with making such a promise based on t-opsem FCP, or whether they would like to be included in the FCP.
Related: https://github.com/rust-lang/rust/issues/74990 , https://github.com/rust-lang/rust/issues/115285 , https://github.com/rust-lang/reference/pull/1226
2024-09-29 05:54:47 +00:00
Michael Goulet
c682aa162b
Reformat using the new identifier sorting from rustfmt
2024-09-22 19:11:29 -04:00
Kyle J Strand
249d3d2644
update docs for catch_unwind & related funcs
...
Documentation comments for `catch_unwind` and `thread::join` to indicate
new behavioral guarantee when catching a foreign exception.
2024-09-15 16:13:38 -06:00
Christopher Durham
7e7ccb25b4
add std::panic::abort_unwind
2024-09-14 01:41:00 -04:00
joboet
8542cd67f0
std: do not overwrite style in get_backtrace_style
...
If another thread calls `set_backtrace_style` while a `get_backtrace_style` is reading the environment variables, `get_backtrace_style` will overwrite the value. Use an atomic CAS to avoid this.
2024-08-12 10:08:56 +02:00
Konippi
a798e0f488
chore: refactor backtrace style in panic
2024-08-03 11:12:16 +09:00
bors
f8060d282d
Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68
...
Bump bootstrap compiler to new beta
https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30 17:49:08 +00:00
Nicholas Nethercote
84ac80f192
Reformat use declarations.
...
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Mark Rousskov
e8644f85b8
Update CURRENT_RUSTC_VERSION
2024-07-28 14:46:29 -04:00
John Arundel
a19472a93e
Fix doc nits
...
Many tiny changes to stdlib doc comments to make them consistent (for example
"Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph
breaks, backticks for monospace style, and other minor nits.
https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-26 13:26:33 +01:00
Mara Bos
2944eab5e6
Use payload_as_str instead of two downcasts.
2024-06-12 13:15:29 +02:00
Mara Bos
a345c3daf6
Bump deprecation of std's PanicInfo alias to 1.82.0.
2024-06-11 15:47:00 +02:00
Mara Bos
de07c1a928
Add PanicHookInfo::payload_as_str().
2024-06-11 15:47:00 +02:00
Mara Bos
32bfe703e2
Add note on panic payload type.
2024-06-11 15:47:00 +02:00
Mara Bos
ce0bc8bd58
Downcast panic payload to String too in example.
2024-06-11 15:47:00 +02:00
Mara Bos
f5fe82fdca
Move deprecation of std::panic::PanicInfo to 1.80.0.
2024-06-11 15:47:00 +02:00
Mara Bos
64e56db72a
Rename std::panic::PanicInfo to PanicHookInfo.
2024-06-11 15:47:00 +02:00
Mara Bos
0087d89983
Mark some PanicInfo methods as #[inline] for consistency.
2024-06-11 15:46:59 +02:00
Mara Bos
0642cb2994
Remove std::panic::PanicInfo::internal_constructor+set_payload.
...
We can just set the payload immediately in the constructor,
and the constructor does not need to be public.
2024-06-11 15:46:59 +02:00
Mara Bos
331b8a3edd
Fix doc link.
2024-06-11 15:46:59 +02:00
Mara Bos
a519dc85f8
Document difference between core and std's PanicInfo.
2024-06-11 15:46:59 +02:00
Mara Bos
e3e815370e
Split core's PanicInfo and std's PanicInfo.
2024-06-11 15:46:59 +02:00
Ralf Jung
42972f52de
catch_panic: warn about panicking payload drop
2024-03-31 11:54:16 +02:00
Jonathan Johnson
55129453c6
Implement unwind safety for Condvar
...
Closes #118009
This commit adds unwind safety to Condvar. Previously, only select
platforms implemented unwind safety through auto traits. Known by this
committer: Linux was unwind safe, but Mac and Windows are not before
this change.
2024-02-28 14:56:36 -08:00
GnomedDev
7ea4dbbadb
Store SHOULD_CAPTURE as AtomicU8
2024-01-31 13:58:52 +00:00
Ralf Jung
af4913fcf4
merge core_panic feature into panic_internals
2023-12-09 14:49:00 +01:00
David Tolnay
2f5d993945
Shorten lifetime of even more panic temporaries
2023-05-15 03:47:37 -07:00
David Tolnay
cb109a672d
Shorten lifetime of panic temporaries in panic_fmt case
2023-05-14 07:27:20 -07:00
Gus Caplan
3ae03c7aee
review
2023-03-17 21:00:10 -07:00
Gus Caplan
d1712f49d7
move default backtrace setting to sys
2023-03-17 20:59:28 -07:00
Albert Larsan
cb7c8993b9
Clarify catch_unwind docs about panic hooks
...
Makes it clear from catch_unwind docs that the panic hook will be called
before the panic is caught.
2022-12-28 16:54:42 +01:00
Andrew Pollack
88baf8f6f5
Adding backtrace off option for fuchsia targets
2022-09-14 23:54:40 +00:00
Jane Lusby
e7fe5456c5
Support unstable moves via stable in unstable items
2022-07-08 21:18:13 +00:00
Mark Rousskov
85930c8f44
Configure panic hook backtrace behavior
2022-02-02 13:46:42 -05:00
Badel2
8bdf5c3de6
Implement panic::update_hook
2022-01-07 17:28:20 +01:00
Gary Guo
9370156957
Deduplicate panic_fmt
...
std's begin_panic_fmt and core's panic_fmt are duplicates.
Merge them to declutter code and remove a lang item.
2021-10-19 15:02:21 +01:00
Gary Guo
11c0e58c74
Allow panic!("{}", computed_str) in const fn.
2021-09-15 21:56:43 +01:00
David Tolnay
4e17994b2c
Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core
2021-07-30 10:42:15 -07:00
bors
fe1c942eee
Auto merge of #87445 - amalik18:issue-83584-fix, r=kennytm
...
Fix may not to appropriate might not or must not
I went through and changed occurrences of `may not` to be more explicit with `might not` and `must not`.
2021-07-30 04:34:13 +00:00
Ali Malik
e43254aad1
Fix may not to appropriate might not or must not
2021-07-29 01:15:20 -04:00
Mara Bos
b64c4f9560
Add new const_format_args!() macro and use it in panics.
2021-07-28 16:12:25 +02:00
Roxane Fruytier
06afafd492
Use diagnostic items to check for Send, UnwindSafe and RefUnwindSafe traits
2021-06-29 17:47:57 -04:00
Roxane Fruytier
3e569dd2df
Remove lang items Send, UnwindSafe and RefUnwindSafe
2021-06-29 17:47:57 -04:00
Mark Rousskov
06661ba759
Update to new bootstrap compiler
2021-06-28 11:30:49 -04:00
Alex Veber
ef13f27bc7
Add #[track_caller] to panic_any
2021-05-27 14:19:47 +03:00