rust/library/core
Matthias Krüger 6c3fce90cc
Rollup merge of #124954 - kpreid:fmterr, r=Nilstrieb
Document proper usage of `fmt::Error` and `fmt()`'s `Result`.

I've seen several newcomers wonder why `fmt::Error` doesn't have any error detail information, or propose to return it in response to an error condition found inside a `impl fmt::Display for MyType`.

That is incorrect, per [a lone paragraph of the `fmt` module's documentation](https://doc.rust-lang.org/1.78.0/std/fmt/index.html#formatting-traits). However, users looking to implement a formatting trait won't necessarily look there. Therefore, let's add the critical information (that formatting per se is infallible) to all the involved items: every `fmt()` method, and `fmt::Error`.

This PR is not intended to make any novel claims about `fmt`; only to repeat an existing one in places where it will be more visible.
2024-05-11 13:16:40 +02:00
..
benches Add benchmarks for impl Debug for str 2024-05-01 09:54:29 +02:00
src Rollup merge of #124954 - kpreid:fmterr, r=Nilstrieb 2024-05-11 13:16:40 +02:00
tests Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
Cargo.toml Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00