Make Rustdoc exit with correct error code when scraping examples from invalid files#99976
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 1, 2022
Merged
Conversation
Contributor
|
r? @jsha (rust-highfive has picked a reviewer for you, use r? to override) |
jyn514
approved these changes
Aug 1, 2022
Member
jyn514
left a comment
There was a problem hiding this comment.
Can you add a UI test? r=me with that done
6c64d69 to
437dccf
Compare
437dccf to
a93feaf
Compare
Contributor
Author
|
@jyn514 done! |
jyn514
reviewed
Aug 1, 2022
| | ^^^^^^^^^^^^ 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 |
Member
There was a problem hiding this comment.
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.
Member
|
@bors r+ rollup Thanks! |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 1, 2022
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.