-
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
Cleanup the shim code #47865
Merged
Merged
Cleanup the shim code #47865
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e07aecd
Make make_clone_call take a Place argument
Manishearth 7fd3c27
Write directly to the RETURN_PLACE in tuple_like_shim
Manishearth c614097
Remove AggregateKind argument from tuple_like_shim
Manishearth 48a7a1f
Document the index used in AggregateKind::Adt
Manishearth ef4f486
Use dest,src ordering for make_clone_call
Manishearth f976291
Correctly subst the fn_sig so that we get the correct types
Manishearth dfd244d
Eliminate ret_field and ret intermediates in array clone shim
Manishearth 8a8f91b
Generalize tuple_like_shim's code to be useful for enums
Manishearth 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 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 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
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.
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.
is there a test for whatever motivated this commit?
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.
Without this commit everything ICEs. Everything.
Any code instantiating a clone shim of tuples or arrays or closures (libcore does) will break because the type used will be TySelf (not TyArray or TyClosure or whatever) and we'll get errors because we're trying to call
.index()
or.field()
on a place that can't be indexed. I can leave a comment to this effect somewhere.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.
I mean I can see why this is wrong, but I'm a bit confused -- the code works now, afaik, right? Or is this just patching up some earlier commit of yours?
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.
It breaks once the change to the array shim is made - anything that depends on the type (e.g. indexing or enum discriminants) starts breaking because it'd see an unsubstituted
Self
.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.
Thsi commit should be earlier in the series I think.
We basically don't hit it because we write to temporary Places and then copy and that works well. I don't recall the exact details, but eddyb can explain.
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.
ok good enough
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.
Oh right yeah this doesn't break the tuple stuff but it does break the array stuff (and the enum stuff from my other PR)