Uh oh!
There was an error while loading. Please reload this page.
Fix LazyLock poison panic message - #145307
Conversation
2aea6c2 to
e77c6fcCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Aug 19, 2025
☔ The latest upstream changes (presumably #145489) made this pull request unmergeable. Please resolve the merge conflicts. |
e77c6fc to
3ead751Compare
This comment has been minimized.
This comment has been minimized.
connortsui20
commented
Aug 19, 2025
@bjorn3 just a bump on my question in #145307 (comment), do you think it makes sense to add an argument to every implementation's Though I might be misunderstanding something: My understanding of the issue here is just that |
bjorn3
commented
Aug 19, 2025
A foreign exception would be for example a C++ exception that unwinds though Rust code. Foreign exceptions can't be safely catched and rethrown. For example for C++ this would require calling a C++ runtime function to link the exception from the list of exceptions and later relink it. We can't do this in Rust as we can't depend on any particular C++ runtime or even any C++ runtime existing at all. For this reason trying to catch a foreign exception currently aborts the entire process. |
3ead751 to
8e848c0Comparerustbot
commented
Aug 21, 2025
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
8e848c0 to
d1f2324Compare
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fixes an issue where if the underlying `Once` panics because it is poisoned, the panic displays the wrong message. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
d1f2324 to
06eb782Compare| #[test] | ||
| #[should_panic = "has previously been poisoned"] | ||
| fn lazy_force_mut_panic() { | ||
| let mut lazy = LazyLock::<String>::new(|| panic!()); | ||
| panic::catch_unwind(panic::AssertUnwindSafe(|| { | ||
| let _ = LazyLock::force_mut(&mut lazy); | ||
| })) | ||
| .unwrap_err(); | ||
| let _ = &*lazy; | ||
| } |
There was a problem hiding this comment.
This is moved down and renamed to lazy_deref_mut_panic
Amanieu
commented
Aug 22, 2025
@bors r+ |
bors
commented
Aug 22, 2025
…r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in rust-lang#144872 (comment) r? `@Amanieu`
Rollup of 7 pull requests Successful merges: - #144452 (std/sys/fd: Relax `READ_LIMIT` on Darwin) - #145307 (Fix `LazyLock` poison panic message) - #145515 (Optimize `char::encode_utf8`) - #145540 (interpret/allocation: get_range on ProvenanceMap) - #145774 (Remove default opts from config) - #145780 (Do not warn about missing change ID in tarball builds) - #145781 (Remove profile section from Clippy) r? `@ghost` `@rustbot` modify labels: rollup
…r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in rust-lang#144872 (comment) r? ``@Amanieu``
…r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in rust-lang#144872 (comment) r? `@Amanieu`
…r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in rust-lang#144872 (comment) r? ``@Amanieu``
Rollup of 6 pull requests Successful merges: - #144531 (Add lint against integer to pointer transmutes) - #144885 (Implement some more checks in `ptr_guaranteed_cmp`. ) - #145307 (Fix `LazyLock` poison panic message) - #145554 (rustc-dev-guide subtree update) - #145798 (Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES`) - #145799 (std/src/lib.rs: mention "search button" instead of "search bar") r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 5 pull requests Successful merges: - #144531 (Add lint against integer to pointer transmutes) - #145307 (Fix `LazyLock` poison panic message) - #145554 (rustc-dev-guide subtree update) - #145798 (Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES`) - #145799 (std/src/lib.rs: mention "search button" instead of "search bar") r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #145307 - connortsui20:lazylock-poison-msg, r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in #144872 (comment) r? ```@Amanieu```
jhpratt
commented
Aug 24, 2025
still in queue @bors r- |
bors
commented
Aug 24, 2025
jhpratt
commented
Aug 24, 2025
@bors r- retry |
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144531 (Add lint against integer to pointer transmutes) - rust-lang/rust#145307 (Fix `LazyLock` poison panic message) - rust-lang/rust#145554 (rustc-dev-guide subtree update) - rust-lang/rust#145798 (Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES`) - rust-lang/rust#145799 (std/src/lib.rs: mention "search button" instead of "search bar") r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144531 (Add lint against integer to pointer transmutes) - rust-lang/rust#145307 (Fix `LazyLock` poison panic message) - rust-lang/rust#145554 (rustc-dev-guide subtree update) - rust-lang/rust#145798 (Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES`) - rust-lang/rust#145799 (std/src/lib.rs: mention "search button" instead of "search bar") r? `@ghost` `@rustbot` modify labels: rollup
…r=Amanieu Fix `LazyLock` poison panic message Fixes the issue raised in rust-lang#144872 (comment) r? ```@Amanieu```
Fixes the issue raised in #144872 (comment)
r? @Amanieu