granite-rust/library/core
Matthias Krüger 5107c4c556
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.
2023-04-14 21:11:12 +02:00
..
benches Auto merge of #108157 - scottmcm:tuple-gt-via-partialcmp, r=dtolnay 2023-03-05 22:02:26 +00:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #110110 - lukas-code:display-panic-info, r=JohnTitor 2023-04-14 21:11:12 +02:00
tests remove obsolete test 2023-04-10 21:57:45 +02:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00