-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
RFC 2070 part 1: PanicInfo and Location API changes #47687
Conversation
Due to being in libcore, this impl cannot access PanicInfo::payload if it’s a String.
…tring. This enables PanicInfo’s Display impl to show the panic message in those cases.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @bluss (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/libcore/panic.rs
Outdated
/// | ||
/// panic!("Normal panic"); | ||
/// ``` | ||
#[stable(feature = "panic_col", since = "1.25")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's correct this to 1.25.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, and other similar occurrences.
@rfcbot fcp merge Looks great to me, thanks @SimonSapin! |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
/// A struct providing information about a panic. | ||
/// | ||
/// `PanicInfo` structure is passed to a panic hook set by the [`set_hook`] | ||
/// function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the documentation should mention the no-std case.
Ping for ticky boxes @BurntSushi, @Kimundi! |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@bors r+ |
📌 Commit 399dcd1 has been approved by |
⌛ Testing commit 399dcd1 with merge 19a8766c42c47b4a3769394a4f79e4cef31def87... |
💔 Test failed - status-travis |
|
RFC 2070 part 1: PanicInfo and Location API changes This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html Tracking issue: #44489 * Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`. * Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`. * Implement `Display` for `PanicInfo` and `Location`
☀️ Test successful - status-appveyor, status-travis |
Correct a few stability attributes * `const_indexing` language feature was stabilized in 1.26.0 by #46882 * `Display` impls for `PanicInfo` and `Location` were stabilized in 1.26.0 by #47687 * `TrustedLen` is still unstable so its impls should be as well even though `RangeInclusive` was stabilized by #47813 * `!Send` and `!Sync` for `Args` and `ArgsOs` were stabilized in 1.26.0 by #48005 * `EscapeDefault` has been stable since 1.0.0 so should continue to show that even though it was moved to core in #48735 This could be backported to beta like #49612
This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html
Tracking issue: #44489
std::panic::PanicInfo
andstd::panic::Location
to a newcore::panic
module. The two types and thestd
module were already#[stable]
and stay that way, the newcore
module is#[unstable]
.PanicInfo::message(&self) -> Option<&fmt::Arguments>
method, which is#[unstable]
.Display
forPanicInfo
andLocation