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

Default panic message should print Box<dyn Any> #86074

Merged
merged 2 commits into from
Jun 8, 2021

Conversation

reaganmcf
Copy link
Contributor

Closes #86039

Prior to this patch, the panic message from running the following code would be thread 'main' panicked at 'Box<Any>'...

use std::panic::panic_any;
fn main() {
    panic_any(42);
}

This patch updates the phrasing to be more consistent. It now instead shows the following panic message:

thread 'main' panicked at 'Box<dyn Any>', ...

It's a very small fix 😄

Prior to this patch, the default panic message (resulting from calling
`panic_any(42);` for example), would print the following error message:

```
thread 'main' panicked at 'Box<Any>', ...
```

However, this should be `Box<dyn Any>` instead.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 6, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 6, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 6, 2021

📌 Commit eb3fd6d has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 6, 2021

Thanks for the fix!

@rust-log-analyzer

This comment has been minimized.

This patch fixes tests from failing that were matching on `Box<Any>`,
which was the old panic message. Since the new panic message is `Box<dyn
Any>`, the tests have been updated to match against this instead.
@jyn514
Copy link
Member

jyn514 commented Jun 6, 2021

@bors r- (until ci is passing)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 6, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 7, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Jun 7, 2021

📌 Commit 8330233 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 7, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 7, 2021
Default panic message should print Box<dyn Any>

Closes rust-lang#86039

Prior to this patch, the panic message from running the following code would be `thread 'main' panicked at 'Box<Any>'...`
```rust
use std::panic::panic_any;
fn main() {
    panic_any(42);
}
```

This patch updates the phrasing to be more consistent. It now instead shows the following panic message:

```
thread 'main' panicked at 'Box<dyn Any>', ...
```

It's a very small fix 😄
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 8, 2021
Default panic message should print Box<dyn Any>

Closes rust-lang#86039

Prior to this patch, the panic message from running the following code would be `thread 'main' panicked at 'Box<Any>'...`
```rust
use std::panic::panic_any;
fn main() {
    panic_any(42);
}
```

This patch updates the phrasing to be more consistent. It now instead shows the following panic message:

```
thread 'main' panicked at 'Box<dyn Any>', ...
```

It's a very small fix 😄
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 8, 2021
Rollup of 11 pull requests

Successful merges:

 - rust-lang#85906 (Use `Iterator::find` instead of open-coding it)
 - rust-lang#85951 (Update the documentation of `-C force-unwind-tables` for rust-lang#83482)
 - rust-lang#85985 (Clarify documentation of slice sorting methods)
 - rust-lang#85989 (Remove rustfmt tests from top-level .gitattributes)
 - rust-lang#86074 (Default panic message should print Box<dyn Any>)
 - rust-lang#86078 (Type page font weight)
 - rust-lang#86090 (:arrow_up: rust-analyzer)
 - rust-lang#86095 (Search description codeblock)
 - rust-lang#86096 (Comment out unused error codes and add description for E0316)
 - rust-lang#86101 (Correct type signature in doc for Bound::as_mut)
 - rust-lang#86103 (Remove lifetime hack)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b7d05f8 into rust-lang:master Jun 8, 2021
@rustbot rustbot added this to the 1.54.0 milestone Jun 8, 2021
bors added a commit to rust-lang/miri that referenced this pull request Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default panic message prints the type Box<dyn Any> as Box<Any>
7 participants