Make cycle errors recoverable#102037
Merged
bors merged 3 commits intorust-lang:masterfrom Sep 22, 2022
Merged
Conversation
This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter.
In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation. In the past, `@jackh726` has said we need to be careful about overflow errors: > Off the top of my head, we definitely should be careful about treating overflow errors the same as "not implemented for some reason" errors. Otherwise, you could end up with behavior that is different depending on recursion depth. But, that might be context-dependent. But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.
5 tasks
Contributor
|
that seems fine to me, even recursion limit errors should be alright. cc @rust-lang/types @bors r+ |
Collaborator
lcnr
reviewed
Sep 20, 2022
| if let FulfillmentErrorCode::CodeCycle(cycle) = err.code { | ||
| infcx.report_overflow_error_cycle(&cycle); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
that's a bit unfortunate, but seems acceptable for now and something we can definitely fixchange later.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Sep 20, 2022
Make cycle errors recoverable In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation. In the past, `@jackh726` has said we need to be careful about overflow errors: rust-lang#91430 (comment) > Off the top of my head, we definitely should be careful about treating overflow errors the same as "not implemented for some reason" errors. Otherwise, you could end up with behavior that is different depending on recursion depth. But, that might be context-dependent. But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered. Helps with rust-lang#81091. r? `@lcnr` cc `@matthewjasper`
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Sep 22, 2022
Make cycle errors recoverable In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation. In the past, ``@jackh726`` has said we need to be careful about overflow errors: rust-lang#91430 (comment) > Off the top of my head, we definitely should be careful about treating overflow errors the same as "not implemented for some reason" errors. Otherwise, you could end up with behavior that is different depending on recursion depth. But, that might be context-dependent. But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered. Helps with rust-lang#81091. r? ``@lcnr`` cc ``@matthewjasper``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 22, 2022
Rollup of 8 pull requests Successful merges: - rust-lang#101598 (Update rustc's information on Android's sanitizers) - rust-lang#102036 (Remove use of `io::ErrorKind::Other` in std) - rust-lang#102037 (Make cycle errors recoverable) - rust-lang#102069 (Skip `Equate` relation in `handle_opaque_type`) - rust-lang#102076 (rustc_transmute: fix big-endian discriminants) - rust-lang#102107 (Add missing space between notable trait tooltip and where clause) - rust-lang#102119 (Fix a typo “pararmeter” in error message) - rust-lang#102131 (Added which number is computed in compute_float.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Collaborator
|
☔ The latest upstream changes (presumably #102139) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation.
In the past, @jackh726 has said we need to be careful about overflow errors: #91430 (comment)
But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.
Helps with #81091.
r? @lcnr cc @matthewjasper