Skip to content

Add basic doc examples for std::panic::{set_hook, take_hook}. #36390

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

Merged
merged 1 commit into from
Sep 18, 2016

Conversation

frewsxcv
Copy link
Member

No description provided.

@frewsxcv
Copy link
Member Author

r? @GuillaumeGomez

/// use std::panic;
///
/// panic::set_hook(Box::new(|_| {
/// println!("Caught a panic!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to stay away from the word "catch" here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Encountered"?

@frewsxcv frewsxcv force-pushed the panic-set-hook branch 4 times, most recently from 30587c8 to 0c3d290 Compare September 16, 2016 22:47
@frewsxcv
Copy link
Member Author

@GuillaumeGomez Added an example for take_hook.

@GuillaumeGomez
Copy link
Member

Euh...

Compiling rustc_metadata v0.0.0 (file:///build/src/librustc_metadata)
error[E0282]: unable to infer enough type information about `_`
   --> src/librustc_metadata/decoder.rs:358:25
    |
358 |             predicates: (0..self.read_usize()?).map(|_| {
    |                         ^ cannot infer type for `_`
    |
    = note: type annotations or generic parameter binding required

error: aborting due to previous error

I restart travis.

@frewsxcv frewsxcv force-pushed the panic-set-hook branch 2 times, most recently from 1dc4db1 to ee5f602 Compare September 17, 2016 14:49
@frewsxcv
Copy link
Member Author

@GuillaumeGomez Tests are passing now.

@frewsxcv frewsxcv changed the title Add basic doc example for std::panic::set_hook. Add basic doc examples for std::panic::{set_hook, take_hook}. Sep 17, 2016
@GuillaumeGomez
Copy link
Member

Great, thanks!

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 18, 2016

📌 Commit 5505ebc has been approved by GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Sep 18, 2016

⌛ Testing commit 5505ebc with merge 3392775...

bors added a commit that referenced this pull request Sep 18, 2016
Add basic doc examples for `std::panic::{set_hook, take_hook}`.

None
@bors bors merged commit 5505ebc into rust-lang:master Sep 18, 2016
@frewsxcv frewsxcv deleted the panic-set-hook branch October 2, 2016 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants