-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: properly detect input file exists #27074
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
Conversation
The compiler's actually already spitting out the right error message here, it's just that none of the subsequent panic messages are being suppressed. To solve this I think it'd be better to handle the panic messages in the same manner as the compiler, only emitting some of them for major errors. |
@alexcrichton what about this second commit instead? It now prints out
Handling bad input proactively just seems like a good idea to me, personally, rather than letting some inner thing panic. |
rustdoc currently has a bad error message for any panic on behalf of the compiler (e.g. any compiler error message), so I think it'd be best to fix both issues instead of just special casing this one |
word. i'll try to figure out where that is. |
All of rustc's logic is in the |
Nice! using
That last extra message happens because of https://github.com/rust-lang/rust/blob/master/src/librustdoc/lib.rs#L135 Given that we're setting up a 32MB stack here, I guess I can't turn this spawn into a monitor either, eh? What should I do here? |
I think it's fine to change that |
ahhh yes. I just started |
Nah I think that should do it! |
@@ -56,7 +56,7 @@ extern crate serialize as rustc_serialize; // used by deriving | |||
use std::cell::RefCell; | |||
use std::collections::HashMap; | |||
use std::env; | |||
use std::fs::File; | |||
use std::fs::{self, File}; |
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.
doesn't look like this change is needed
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.
yes, it's since been removed
When rustc gives an error, there's a ton of extra output from the panic. Now, we use monitor() to supress the excess output. Fixes rust-lang#27014
Fixes #27014 r? @alexcrichton I'm not 100% sure there's not a better way to do this, but it works. Also, I wasn't sure how, where, or if to write a test for this.
Fixes #27014
r? @alexcrichton
I'm not 100% sure there's not a better way to do this, but it works.
Also, I wasn't sure how, where, or if to write a test for this.