-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Initial UnsafePinned
impl [Part 2: Lowering]
#139896
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
"always" sounds wrong; a movable coroutine could have an I understand this is consistent with what we do with
This is missing context -- what is the interaction with niche ops? |
f44b09f
to
03ef470
Compare
Updated the trait solving logic to only implement
#129313 Disabled niches in coroutines because of #63818. The planned "Part 3: Codegen" will restore this. |
I'm not sure how to write tests checking impls of |
@@ -711,6 +722,7 @@ fn locals_live_across_suspend_points<'tcx>( | |||
// of the local, which happens using the `intersect` operation below. | |||
borrowed_locals_cursor.seek_before_primary_effect(loc); | |||
live_locals.union(borrowed_locals_cursor.get()); | |||
locals_borrowed_across_any_suspension_point.union(borrowed_locals_cursor.get()); |
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 should prob use its own dataflow analysis to avoid false positives (see borrow_not_held_across_yield
mir test) (EDIT: WIP)
Coroutine lowering part of RFC 3467.
Tracking issue: #125735
Part 1: #137043
UnsafeUnpin
for coroutines:UnsafeUnpin
. (movable coros never have pinned fields)UnsafeUnpin
iff none of its fields are pinned.Still TODO (for later PRs):
@rustbot label F-unsafe_pinned F-coroutines A-coroutines
cc @RalfJung @compiler-errors @traviscross