-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Normalization for long error codes explanations RFC #1567
Conversation
@GuillaumeGomez you might want to edit that title/commit message. |
@Stebalien: Oh indeed, I didn't pay attention... Thanks! |
@Manishearth said 👍 on IRC. I am generally in favor of this RFC, but I would also like to hear from the people who have contributed to these messages the most. I was going to check the issue we had for error codes, but cannot find it right now. @GuillaumeGomez , do you happen to have a link? |
@steveklabnik, do you mean this issue? |
@AndrewBrinker yes! So, @michaelsproul, @lifthrasiir @lfairy @ruud-v-a @nham @caipre @cactorium @pnkfelix @AlisdairO @nathankleyn @joelmccracken and anyone else, thoughts on this RFC? @pnkfelix makes a good point in that thread that isn't addressed here, but might be nice to add: rust-lang/rust#24407 (comment) |
|
||
## First point | ||
|
||
Giving a little more detailed error message. For example, the `E0109` spans "type parameters are not allowed on this type" and the error explanation says: "You tried to give a type parameter to a type which doesn't need it.". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"For example, E0109
says "..."". "spans" isn't the right word to use here.
I think they should since error explanations will come along with (normally) this unstable feature. But before that, they shouldn't be displayed or available for a non-nightly compiler. |
A few thoughts:
I can see how this helps writing new examples, but I don’t see how this will help users. |
Just mention each. We do this already. https://doc.rust-lang.org/nightly/error-index.html#E0401 is an example
we don't yet test code examples in the index. But if we did, that would be correct.
IMO loose starting point. Current explanations follow this more or less, since I've been unofficially enforcing something close to this set of guidelines when reviewing this PRs. |
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".
You're supposed to provide a code example as small as possible to isolate the error and to show from where it comes.
I think it should be used as a base. The current situation isn't that bad, but can be greatly improved.
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. |
@Manishearth: We actually do. I added it here. |
A template, in a way similar to a checklist, helps ensure that an error message contains everything that it should. I like it. I suggest that the labels for the points in the template might improve. This would make the template itself easier to read and work with: [First point] -> [Slightly more detailed error message. 50-100 words.] |
No, I prefer avoid adding limits. Some error messages need to be really complete. If I set a word "limit", they'll focus on it and I want to avoid that. |
Sure, that makes sense. The word limit was an afterthought, anyway. |
> fn cake(); | ||
> } | ||
> ``` | ||
> "##, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is messed up with the code blocks here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything wrong. What are you referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @bjz is referring to the fact that ""##," displays inline in the rendered markdown. I am not sure if that is intentional but it does look a little odd on the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arf, I don't know how markdown works in there. I was expecting that it wouldn't "interpret" in quote block.
👍 sounds like a great plan to me! |
Why are the labels "first point" etc.? A more semantic label/title/guideline would make more sense to me. I'd be keen to emphasise that the template is a guideline, rather than a requirement - good docs often need quite a lot of specialisation, and docs which are obviously forced into a template often read badly. Having said that, +1 on the RFC overall. |
With what would you replace it?
I wrote a lot of error code explanations, and that's the more common template I fulfilled. Of course, this is "just" a guideline and some cases can't fulfill it (this template), but they remain exceptions and have to be treated on their own (even if they remain close to this RFC). However, I think it's preferable to have a guideline and start to write something from it and then specialize the explanation if needed (and you can do it a lot). That's what has been done unofficially like @Manishearth said and it worked well. |
Still needs some work but we can try to make obvious what each section should contain
|
@gnzlbg: I see, I'll update it. |
I was also trying to say this. Ignore the bits I said about the word count; the other part is label name suggestions. |
Updated. |
|
||
# Summary | ||
|
||
Long error codes explanations haven't been normalized yet. For example, actually, not all error codes explanation provide an erroneous code example or a way to fix the error. This RFC intends to clarify this by providing a template to follow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"For example, actually" can become "For example".
"not all error codes explanation" -> "not all error code's explanations"
"This RFC intends to clarify this by providing a template to follow." -> "This RFC intends to clarify long error codes by providing a template to follow".
Okay everyone! It seems like the discussion here has largely died down, so we are moving this RFC into its final comment period! 🎊 |
Took a read through this morning, and this RFC looks great to me. Thanks @GuillaumeGomez! |
Thanks for your feedback @aturon! |
lgtm |
Like @nham, I'm not enthusiastic about standardizing on the verbatim phrase "Example of erroneous code:". |
I wonder, is erroneous a bit of a poor word choice in this context? Not everyone programming in Rust speaks/reads English as their first language, and it may be preferable to choose a simpler word for this reason. |
I'm french and I don't see the problem with this word (and I don't think that I have an amazing english level). |
I am terrible at english, and I don't see a problem neither. |
How about "Sample (or example) of incorrect code:"? |
@Manishearth, this wording sounds better to me. Also, I realize this is a minor issue. If it's really not an issue in practice (and @GuillaumeGomez and @ticki seem to think it isn't), it may not be worth a change. |
We already debated about this sentence. I don't know what to add about it. I put back the url. |
Huzzah! The not-quite-real docs team, in conjunction with the core team, has decided to accept this RFC. Thank you all! |
I had to do a rebase, so #1648 closed this. |
We talked about it at the first meeting of the rust doc (unofficial) team so here it is: the RFC for the error codes explanations normalization!
cc @steveklabnik
Rendered.