-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[WIP] defer adding implicit Sized
bounds
#86371
Closed
Closed
Conversation
This file contains 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
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.
rustbot
added
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
A-traits
Area: Trait system
A-typesystem
Area: The type system
labels
Jun 16, 2021
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 16, 2021
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #84623) made this pull request unmergeable. Please resolve the merge conflicts. |
inquisitivecrystal
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Aug 24, 2021
Can you rebase? I have to go through this, but this has changed a bit on master. |
jackh726
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 9, 2021
Closing this as inactive |
Dylan-DPC
added
S-inactive
Status: Inactive and waiting on the author. This is often applied to closed PRs.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Mar 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
A-traits
Area: Trait system
A-typesystem
Area: The type system
S-inactive
Status: Inactive and waiting on the author. This is often applied to closed PRs.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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
Sized
bounds to the predicate list, so that any explicitSized
bounds, 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
where
clauses.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
Sized
predicates 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