-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make Rustdoc exit with correct error code when scraping examples from invalid files #99976
Conversation
r? @jsha (rust-highfive has picked a reviewer for you, use r? to override) |
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.
Can you add a UI test? r=me with that done
6c64d69
to
437dccf
Compare
437dccf
to
a93feaf
Compare
@jyn514 done! |
| ^^^^^^^^^^^^ could not resolve path `INVALID_FUNC` | ||
| | ||
= note: this error was originally ignored because you are running `rustdoc` | ||
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error |
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.
lol so that's where this error will show up in practice, I mostly just added it for completeness
yeah this seems ok; it points to the right place and gives you an idea of what's going wrong. The only thing to improve is that rustdoc doesn't need to tell the resolver to ignore errors in the first place when scraping examples, but that will be kind of annoying to fix for very marginal benefit.
@bors r+ rollup Thanks! |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#99340 (Fix ICE in Definitions::create_def) - rust-lang#99629 (Improve `cannot move out of` error message) - rust-lang#99864 (bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty) - rust-lang#99911 (Remove some uses of `guess_head_span`) - rust-lang#99976 (Make Rustdoc exit with correct error code when scraping examples from invalid files) - rust-lang#100003 (Improve size assertions.) - rust-lang#100012 (Avoid `Ty` to `String` conversions) - rust-lang#100020 (better error when python is not found in x - issue rust-lang#99648) Failed merges: - rust-lang#99994 (Replace `guess_head_span` with `opt_span`) r? `@ghost` `@rustbot` modify labels: rollup
This PR fixes a small issue with the new Rustdoc scrape-examples feature. If a file that is being scraped has a type error, then currently that error is printed out, but the rustdoc process exits as if it succeeded. This is a problem for Cargo, which needs to track whether scraping succeeded (see rust-lang/cargo#10343).
This PR fixes the issue by checking whether an error is emitted, and aborting if so.