-
Couldn't load subscription status.
- Fork 13.9k
Specify reentrancy gurantees of Once::call_once
#53024
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
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
To expand a bit, I think we can guarantee a deadlock, but I can imagine that, for example, with |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
|
📌 Commit a2f9aaf has been approved by |
Specify reentrancy gurantees of `Once::call_once`
I don't think the docs are clear about what happens in the following code
```rust
static INIT: Once = ONCE_INIT;
INIT.call_once(|| INIT.call_once(|| println!("huh?")));
```
[Playground](https://play.rust-lang.org/?gist=15dde1f68a6ede263c7250c36977eade&version=stable&mode=debug&edition=2015)
Let's "specify" the behavior to make it clear that the current behavior (deadlock I think?) is not a strict guarantee.
Specify reentrancy gurantees of `Once::call_once`
I don't think the docs are clear about what happens in the following code
```rust
static INIT: Once = ONCE_INIT;
INIT.call_once(|| INIT.call_once(|| println!("huh?")));
```
[Playground](https://play.rust-lang.org/?gist=15dde1f68a6ede263c7250c36977eade&version=stable&mode=debug&edition=2015)
Let's "specify" the behavior to make it clear that the current behavior (deadlock I think?) is not a strict guarantee.
|
@bors rollup |
Rollup of 14 pull requests Successful merges: - #51919 (Provide `{to,from}_{ne,le,be}_bytes` functions on integers) - #52940 (Align 6-week cycle check with beta promotion instead of stable release.) - #52968 (App-lint-cability) - #52969 (rustbuild: fix local_rebuild) - #52995 (Remove unnecessary local in await! generator) - #52996 (RELEASES.md: fix the `hash_map::Entry::or_default` link) - #53001 (privacy: Fix an ICE in `path_is_private_type`) - #53003 (Stabilize --color and --error-format options in rustdoc) - #53022 (volatile operations docs: clarify that this does not help wrt. concurrency) - #53024 (Specify reentrancy gurantees of `Once::call_once`) - #53041 (Fix invalid code css rule) - #53047 (Make entire row of doc search results clickable) - #53050 (Make left column of rustdoc search results narrower) - #53062 (Remove redundant field names in structs)
I don't think the docs are clear about what happens in the following code
Playground
Let's "specify" the behavior to make it clear that the current behavior (deadlock I think?) is not a strict guarantee.