-
Notifications
You must be signed in to change notification settings - Fork 13k
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 cycle errors recoverable #102037
Make cycle errors recoverable #102037
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.
that seems fine to me, even recursion limit errors should be alright. cc @rust-lang/types @bors r+ |
if let FulfillmentErrorCode::CodeCycle(cycle) = err.code { | ||
infcx.report_overflow_error_cycle(&cycle); | ||
} | ||
} |
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.
that's a bit unfortunate, but seems acceptable for now and something we can definitely fixchange later.
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`
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``
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
☔ The latest upstream changes (presumably #102139) made this pull request unmergeable. Please resolve the merge conflicts. |
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