diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-14 21:11:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 21:11:12 +0200 |
| commit | 5107c4c556fe9fb319f1330f6562882cf41d3097 (patch) | |
| tree | 3fc4eb15d3d2d13e92284f193231b9495ffa826a /library/std/src | |
| parent | 4b8351f62e178909ff4de605ff2ef4a559e38206 (diff) | |
| parent | d9f99c36fe5122618a44caf393f9743e84a38c19 (diff) | |
| download | rust-5107c4c556fe9fb319f1330f6562882cf41d3097.tar.gz rust-5107c4c556fe9fb319f1330f6562882cf41d3097.zip | |
Rollup merge of #110110 - lukas-code:display-panic-info, r=JohnTitor
Use `Display` in top-level example for `PanicInfo` Addresses https://github.com/rust-lang/rust/issues/110098. This confused me as well, when I was writing a `no_std` panic handler for the first time, so here's a better top-level example. `Display` is stable, prints the `.message()` if available, and falls back to `.payload().downcast_ref<&str>()` if the message is not available. So this example should provide strictly more information and also work for formatted panics. The old example still exists on the `payload` method.
Diffstat (limited to 'library/std/src')
0 files changed, 0 insertions, 0 deletions
