-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add documentation for error E0208 #98011
Add documentation for error E0208 #98011
Conversation
Some changes occurred in diagnostic error codes |
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
fn main() {} | ||
``` | ||
|
||
Below find a table mapping the symbol shown to the variance: |
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.
There is really nothing more to be explained about this error code?
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.
Thanks for your feedback. What else should be explained about this error code?
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.
Try to adopt this point of view: you don't know what this error code is about at all. What information does the reader need to understand why they got this error?
In the current case, you only show a table of variance, but that's far from enough to understand what's going on in 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.
Thanks. A link to the following page would be enough? https://doc.rust-lang.org/nomicon/subtyping.html
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 have just realized it's already there
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 felt the link to the documentation was enough @mbartlett21 What else can I add here?
This comment has been minimized.
This comment has been minimized.
@GuillaumeGomez Can you explain why this failed, please? A similar sentence ("For more information...") was added in the following PR but it worked there #94449 |
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 think that an internal error needs error documentation.
The feature gate specifically says "the #[rustc_error]
attribute is just used for rustc unit tests and will never be stable", and I don't think people working within the compiler need this documentation.
I prepared this PR because this error code is mentioned here #61137 (comment) |
@GuillaumeGomez, perhaps that one should also be marked off the list as unneeded? Edit: Same for E0640, E0711, E0717 |
I made the list based on the undocumented error codes but didn't make difference with internal ones. We can just add a comment like |
Inside |
Yes. Something like this: E0208, // internal error code |
557221e
to
99672fb
Compare
Done |
Thanks! @bors r+ rollup |
📌 Commit 99672fb has been approved by |
…piler-errors Rollup of 3 pull requests Successful merges: - rust-lang#97920 (Fix some test annotations) - rust-lang#97950 (Clarify `#[derive(PartialEq)]` on enums) - rust-lang#98011 (Add documentation for error E0208) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Related to #61137