Uh oh!
There was an error while loading. Please reload this page.
[WIP] defer adding implicit Sized bounds - #86371
Closed
tlyu wants to merge 5 commits into
Closed
Conversation
In `Bounds::predicates()`, move the implicit `Sized` predicate to the end of the generated list. This means that if there is an explicit `Sized` bound, it will be checked first, and any resulting diagnostics will have a more useful span.
Reduce nesting by using early exits and factoring out a helper function. Also add comments explaining why the copying of `?Sized` bounds is necessary.
rust-log-analyzer
commented
Jun 16, 2021
Collaborator
The job Click to see the possible cause of the failure (guessed by this bot) |
bors
commented
Jul 16, 2021
Collaborator
☔ The latest upstream changes (presumably #84623) made this pull request unmergeable. Please resolve the merge conflicts. |
jackh726
commented
Sep 9, 2021
Member
Can you rebase? I have to go through this, but this has changed a bit on master. |
Dylan-DPC
commented
Mar 30, 2022
Member
Closing this as inactive |
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 freeto 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.
Defer adding implicit
Sizedbounds to the predicate list, so that any explicitSizedbounds, not the generic type parameters, are pointed to by diagnostic spans. (It seems to succeed in some cases, but…)This is based on #86011 but taken to a more logical extreme by moving the implicit bounds after the predicates added by the
whereclauses.Unfortunately, this causes lots of changes in diagnostic output. Somewhat worryingly, it seems to break some cycle avoidance heuristics in inference or typechecking. Some of them seem to have depended on the relative position of the implicit
Sizedpredicates in order to break cycles. This seems like it might be a broad class of issues worth addressing, but possibly difficult to track down.r? @estebank
@rustbot label +A-diagnostics +A-inference +A-traits +A-typesystem