Skip to content
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

Adjustments to the panic hook API #32282

Merged
merged 3 commits into from
Mar 18, 2016
Merged

Adjustments to the panic hook API #32282

merged 3 commits into from
Mar 18, 2016

Conversation

sfackler
Copy link
Member

Rename set_handler and take_handler to set_hook and take_hook since we're not actually "handling" (i.e. fixing) anything.

Also alter set_hook to take a Box<Fn(&PanicInfo) + 'static + Sync + Send> rather than a parameterized closure since there's otherwise no easy way to re-register a hook that came from take_hook.

cc #30449

r? @aturon

Otherwise there's no good way of re-registering a hook you got out of
take_hook.
@alexcrichton
Copy link
Member

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 16, 2016
@alexcrichton
Copy link
Member

The libs team discussed this yesterday and the conclusion was to merge this, the naming seems more accurate and the requirement of Box, while not the most ergonomic, reduces the unnecessary allocations at runtime and this should be a rarely used API anyway.

@bors: r+ 50fda1e

@bors
Copy link
Contributor

bors commented Mar 18, 2016

⌛ Testing commit 50fda1e with merge 24bb607...

bors added a commit that referenced this pull request Mar 18, 2016
Adjustments to the panic hook API

Rename `set_handler` and `take_handler` to `set_hook` and `take_hook` since we're not actually "handling" (i.e. fixing) anything.

Also alter `set_hook` to take a `Box<Fn(&PanicInfo) + 'static + Sync + Send>` rather than a parameterized closure since there's otherwise no easy way to re-register a hook that came from `take_hook`.

cc #30449

r? @aturon
@bors bors merged commit 50fda1e into rust-lang:master Mar 18, 2016
@sfackler sfackler deleted the panic-hook branch November 26, 2016 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants