-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Local is copy #68512
Merged
Merged
Local is copy #68512
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a71cc4c
Place conflict functions take Local by value
spastorino 4a86c55
record_killed_borrows_for_local takes Local by value
spastorino 10b19f6
make_integrate_local takes Local by value
spastorino 39d93b1
codegen_place and related functions can take PlaceRef by value
spastorino b5b6be0
Local field on PlaceRef and RootPlace is not a reference anymore
spastorino 22a4827
Place::ty_from takes local by value
spastorino 5f1caa4
./x.py fmt
spastorino a13a7d7
Remove unneeded & on match pattern
spastorino 3021856
Fix some wrong dereferences after rebase
spastorino 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> { | |
// ZSTs don't require any actual memory access. | ||
let elem_ty = base_ty.projection_ty(cx.tcx(), elem).ty; | ||
let elem_ty = self.fx.monomorphize(&elem_ty); | ||
let span = self.fx.mir.local_decls[*place_ref.local].source_info.span; | ||
let span = self.fx.mir.local_decls[place_ref.local].source_info.span; | ||
if cx.spanned_layout_of(elem_ty, span).is_zst() { | ||
return; | ||
} | ||
|
@@ -174,7 +174,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> { | |
// We use `NonUseContext::VarDebugInfo` for the base, | ||
// which might not force the base local to memory, | ||
// so we have to do it manually. | ||
self.visit_local(place_ref.local, context, location); | ||
self.visit_local(&place_ref.local, context, location); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should also take a |
||
} | ||
} | ||
|
||
|
@@ -212,8 +212,8 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> { | |
}; | ||
} | ||
|
||
self.visit_place_base(place_ref.local, context, location); | ||
self.visit_projection(place_ref.local, place_ref.projection, context, location); | ||
self.visit_place_base(&place_ref.local, context, location); | ||
self.visit_projection(&place_ref.local, place_ref.projection, context, location); | ||
} | ||
} | ||
} | ||
|
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
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
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
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
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.
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.
Orthogonal, but the 'a here could be 'tcx, right?
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.
Unsure, I just did it to try out and I'm getting ...
Didn't pay a lot of attention to be honest, should I fix this in this PR or investigate this on a different one?.
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.
no let's do it in another PR.
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 think you should start by replacing
PlaceRef<'_, 'tcx>
withPlaceRef<'tcx, 'tcx>
and see where that breaks down (most things should be able to handle it, although... unsure how useful it is?).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.
This was addressed here #69714