-
Notifications
You must be signed in to change notification settings - Fork 0
Scrabsha/html errors #1
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
base: master
Are you sure you want to change the base?
Conversation
Our goal is to generate HTML pages representing the error emitted by the compiler. This commit adds a -Z html-output flag to rustc. When passed, the compiler will emit its errors in HTML format in stderr. This flag conflicts with any value of the error-format argument. As a bonus, the compiletest crate has been updated to handle the // html-output compiler directive. Adding this flag will invoke the compiler with the -Z html-output flag and compare its output with a corresponding .html file, similarly as .stderr files.
47fbb79
to
b33ccc3
Compare
compiler/rustc_errors/src/emitter.rs
Outdated
Ok(()) => {} | ||
|
||
Err(e) if e.kind() == ErrorKind::WriteZero => return Ok(idx), | ||
Err(e) => return Err(e), |
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.
In practice I don't know if it actually matters (I am assuming that you've run tests and observed it work; I haven't tried to work on the compiler before and so haven't actually downloaded or run this myself), but I think this clause loses the current .next()
segment if it is not able to write into self.inner
, so a retry would skip it. If it works as-is, then I wouldn't worry about 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.
Actually it is not a problem if we don't write the current .next()
, as long as we exit early and return the correct amount of bytes we actually wrote.
But the good news is that you're highlighting the fact that we should not return an error if we wrote something to the sink. I do need to fix that.
Okay so I've played with writing this as a standalone module and while I have some minor practical differences as a result of our prior conversation and seeing your solution first, ultimately I don't think I have anything worth bringing up as an actual change. The I refuse to bikeshed this to a standstill before it even hits |
Thank you so much for taking time to review this piece of code. It's much appreciated. I tried to remove the remove the I'm wondering how you removed the |
No description provided.