-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Move trait prototype
#161457
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
Draft
zannabianca1997
wants to merge
23
commits into
rust-lang:main
Choose a base branch
from
zannabianca1997:move-trait
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Move trait prototype
#161457
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
9595e03
fallible type ops
nia-e 12e2d6a
move trait
nia-e b6dff63
Fix: removed Move from being printed at all
zannabianca1997 0c55a40
Fix: assume Move when the `move_trait` feature is not added
zannabianca1997 51548a7
Fix: preferred printing of `?Move` instead of `Move`
zannabianca1997 94e0cd9
Feat: removed Move from mangled symbols
zannabianca1997 37f046f
Feat: mangling of `?Move` bounds
zannabianca1997 5acdf81
Fix: legacy mangler (Fn printer)
zannabianca1997 f6149f3
Fix: normalized test
zannabianca1997 0556839
Fix: correctly refusing trait objects that have only Move as a bound
zannabianca1997 4c040ec
Fix: line number drift
zannabianca1997 1c74e76
Fix: added now present Move clause
zannabianca1997 68930dd
Fix: missing Move pattern
zannabianca1997 757e345
Fix: removed the move clause from explicit clauses when the feature is
zannabianca1997 c1271cc
Cleanup
zannabianca1997 9f2ad53
Fix: expanded boolean into a more comprehensible enum
zannabianca1997 97fc218
aligned to boolean values
zannabianca1997 bca55d8
Fix: helper to avoid repeating printing pattern
zannabianca1997 ae6089b
Fix: missing prints
zannabianca1997 e8b8473
reborrow! yay.
zannabianca1997 b8a227b
Fix: documented error in feature gate test
zannabianca1997 cb26587
Fix: documented test being fixed under the next solver
zannabianca1997 a068654
Chore: new test use the debug too
zannabianca1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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 one is unfortunately somewhat problematic.
gather_explicit_clauses_ofis used by a query whose result we write to crate metadata, so this would erase theMovebound from upstream crates which don't have the feature enabled.Why is this needed
View changes since the review
Uh oh!
There was an error while loading. Please reload this page.
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.
Of the changes that I made this is the one i was less sure of
I was trying to fix this test
The original test expected
and after the change with
Moveit appeared a new help message= help: if you intendedNto be a const parameter, useconst N: /* Type */insteadnow, the help should not appear as there is a bound - so i checked from where it came, and got to read the
check_type_alias_type_params_are_usedthat uses some sort of euristic to split huser written bounds and the sized hierarchy (?)I honestly lost the plot there, but noticed that it was calling the
_explicit_version. And I saw the doc comment ofgather_explicit_clauses_ofnoting that implied and inferred constraints should not appear there, andMoveis indeed implicit in that case, so I just aligned itUh oh!
There was an error while loading. Please reload this page.
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.
Default bounds (or what this PR now also calls "implicit bounds") are excluded from that. Without knowing all the places where we'll perform
Moveelaboration I would probably revert that.The comment on
gather_explicit_clauses_ofdoesn't consider these bounds to be potential implied bounds (in the sense of implied supertrait bounds, implicit outlives-bounds, etc.). You can see thatgather_explicit_clauses_ofdoes elaborate sizedness & other default bounds.That's because default bounds plus relaxed bounds are just considered syntax sugar / an early syntactic transformation.
Uh oh!
There was an error while loading. Please reload this page.
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.
Regarding the heuristic, it utilizes the fact that implicitly added
Sized(etc.) bounds have the same span as the type parameter they annotate (in order to identify which bounds to "count").So for (pseudo)
<T>, the span of the implicitT: Sizedis identical to the span of type parameterT. The span that's used comes fromexplicit_clauses_of/gather_explicit_clauses_of.I would check what the span we use for implicit
T: Movebounds (Ttype param). If it indeed shares the span with the type param, then there must be something else going on.