rustc_metadata: Make crate loading fully speculative#74071
Merged
bors merged 4 commits intorust-lang:masterfrom Jul 19, 2020
Merged
rustc_metadata: Make crate loading fully speculative#74071bors merged 4 commits intorust-lang:masterfrom
bors merged 4 commits intorust-lang:masterfrom
Conversation
Contributor
|
Some changes occurred in diagnostic error codes |
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This was referenced Jul 5, 2020
Collaborator
|
☔ The latest upstream changes (presumably #74235) made this pull request unmergeable. Please resolve the merge conflicts. |
matthewjasper
approved these changes
Jul 17, 2020
Contributor
matthewjasper
left a comment
There was a problem hiding this comment.
This looks good, r=me with conflicts resolved.
They are deprecated so doing extra work for error recovery doesn't make sense
Contributor
Author
|
@bors r=matthewjasper |
Collaborator
|
📌 Commit 0a4217d has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 19, 2020
…arth Rollup of 7 pull requests Successful merges: - rust-lang#70817 (Add core::task::ready! macro) - rust-lang#73762 (Document the trait keyword) - rust-lang#74021 (impl Index<RangeFrom> for CStr) - rust-lang#74071 (rustc_metadata: Make crate loading fully speculative) - rust-lang#74445 (add test for rust-lang#62878) - rust-lang#74459 (Make unreachable_unchecked a const fn) - rust-lang#74478 (Revert "Use an UTF-8 locale for the linker.") Failed merges: r? @ghost
Member
|
@rust-timer make-pr-for 43ba840 |
rust-timer
added a commit
to rust-timer/rust
that referenced
this pull request
Jul 21, 2020
Original message: Rollup merge of rust-lang#74071 - petrochenkov:cload3, r=matthewjasper rustc_metadata: Make crate loading fully speculative Instead of reporting `span_err`s on the spot crate loading errors are now wrapped into the `CrateError` enum and returned, so they are reported only at the top level `resolve_crate` call, and not reported at all if we are resolving speculatively with `maybe_resolve_crate`. As a result we can attempt loading crates for error recovery (e.g. import suggestions) without any risk of producing extra errors. Also, this means better separation between error reporting and actual logic. Fixes rust-lang#55103 Fixes rust-lang#56590
Contributor
Author
|
This PR shouldn't affect performance in theory, it can potentially execute less code but only when errors are reported. |
Member
|
It was noted as a candidate for performance changes by @nnethercote in #74493; I'm also partially using this as a way to test the tooling for the auto-testing of already landed PRs. |
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.
Instead of reporting
span_errs on the spot crate loading errors are now wrapped into theCrateErrorenum and returned, so they are reported only at the top levelresolve_cratecall, and not reported at all if we are resolving speculatively withmaybe_resolve_crate.As a result we can attempt loading crates for error recovery (e.g. import suggestions) without any risk of producing extra errors.
Also, this means better separation between error reporting and actual logic.
Fixes #55103
Fixes #56590