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 prints the type Box<dyn Any> as Box<Any> #86039

Closed
steffahn opened this issue Jun 5, 2021 · 3 comments · Fixed by #86074
Closed

Default panic message prints the type Box<dyn Any> as Box<Any> #86039

steffahn opened this issue Jun 5, 2021 · 3 comments · Fixed by #86074
Assignees
Labels
A-error-handling Area: Error handling C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@steffahn
Copy link
Member

steffahn commented Jun 5, 2021

use std::panic::panic_any;
fn main() {
    panic_any(42);
}
   Compiling playground v0.0.1 (/playground)
    Finished dev [unoptimized + debuginfo] target(s) in 1.48s
     Running `target/debug/playground`
thread 'main' panicked at 'Box<Any>', src/main.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(playground)

I would’ve expected it to say

thread 'main' panicked at 'Box<dyn Any>', src/main.rs:3:5

Relevant point in std seems to be here.

@rustbot label C-enhancement, T-libs

@rustbot rustbot added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 5, 2021
@inquisitivecrystal
Copy link
Contributor

@rustbot label +A-error-handling

@rustbot rustbot added the A-error-handling Area: Error handling label Jun 5, 2021
@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jun 5, 2021
@reaganmcf
Copy link
Contributor

@rustbot claim

@inquisitivecrystal
Copy link
Contributor

Wow, E-easy issues really do go fast. Best of luck, reaganmcf!

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue 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 issue 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 bors closed this as completed in b7d05f8 Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error-handling Area: Error handling C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants