Closed
Description
On IRC we were discussing how, for complex errors, we ought to put a link to a FAQ in the error message. Perhaps we could even embed the rust manual and print the relevant paragraph if you use rustc --explain
or something.
Some examples of errors that could benefit:
ret
disallowed from within sugared closure{|| ... }
;
required after a statement with non-unit type- etc.
This of course would also entail making such a FAQ. :)
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
brson commentedon Apr 1, 2012
I think this could be really cool, and possibly useful, and has a lot of possibilities. it would be nice if every error had a specific link into the rust documentation for retrieving more info.
brson commentedon Apr 24, 2013
A start to this would simply be adding a way to associate specific errors with stable ids. One possible design would be to create two enums, one in syntax and one in rustc:
Make it implement a trait,
NamedError
that converts the enum to a crate ID (either syntax or rustc)and an error ID (the enum value).Then add a transaction API to diagnostics that takes a
NamedError
, then lets you emit any number of messages related to that error.alexcrichton commentedon May 7, 2013
Just to make sure this was here, I also think it would be great to have example code proving that the check is necessary. Basically some code which shows that if a check weren't in place, the code would crash or it wouldn't be sound in some way.
While I'm at it, I'll also nominate for the production-ready milestone. This would be super-helpful to anyone new to rust.
graydon commentedon May 30, 2013
see also #6806
graydon commentedon May 30, 2013
accepted for production-ready milestone
emberian commentedon Aug 1, 2013
Triage bump
bblum commentedon Oct 20, 2013
i noted in the above issue that a good use case for this would be explaining what the
send
, etc kinds mean.catamorphism commentedon Oct 24, 2013
High, but 1.0. Extra goodwill for anyone who implements this!
emberian commentedon Oct 24, 2013
I was thinking how to implement this the other day actually. Every class of error needs a unique ID first, and a way to expose them when doing span_err etc. Once that infrastructure is in place we can actually have a usable FAQ.
brson commentedon Jan 10, 2014
I'm starting a patch to do this.
12 remaining items