Normalization for long error codes explanations RFC by GuillaumeGomez · Pull Request #1567 · rust-lang/rfcs (original) (raw)

Sometimes very different situations that need to be fixed in different ways can lead to the same error. How would this template handle that?

Such cases are very rare. However, I think it'll be best to consider this PR as a base to apply as much as possible and then handle exceptions "by hand".

For long code samples with a bit of boilerplate, perhaps they should not be repeated entirely if the fix is a one-liner? That would make it harder to test the examples, but it is also easier to see the which parts should be changed. Something like rustdoc’s # in examples might work.

You're supposed to provide a code example as small as possible to isolate the error and to show from where it comes.

Should this be interpreted as a loose starting point, or will all current explanations be shoehorned into this form? I am not necessarily opposed to this, but is the current situation so bad?

I think it should be used as a base. The current situation isn't that bad, but can be greatly improved.

I can see how this helps writing new examples, but I don’t see how this will help users.

We're currently trying to uniformize all rust docs as well. Just like you won't have a website which changes style between pages for consistency, we're trying to apply it here as well to not loose users.