Repository navigation
Add Wrap MIR projection - #166666
Add Wrap MIR projection#166666Jules-Bertholet wants to merge 3 commits into
Wrap MIR projection#166666Conversation
|
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri
cc @rust-lang/clippy This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE machinery
cc @bjorn3 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
|
e3f408f to
ac05035
Compare
UnwrapUnsafeBinder MIR projection with TransmuteWrap MIR projection
|
@rustbot ready |
|
My proposal would have been to keep |
Not for #165010, but other potential uses of this projection I have in mind would need it. |
|
Pre-borrowck transmutes are extremely dangerous... well just like using |
| | ProjectionElem::Wrap(_) => { | ||
| // We don't capture array-access projections. | ||
| // We can stop here as arrays are captured completely. | ||
| // `Wrap` projections currently have no HIR equivalent. |
There was a problem hiding this comment.
It is entirely unclear to me why it would be okay to just break the loop on Wrap. Can you make this bug! instead?
There was a problem hiding this comment.
If Wrap is only accepted after borrowck, then bug! should work fine. There's nothing inherently wrong with breaking, though, it just signals that the Wrap MIR projection can't correspond to any part of a HIR closure capture path.
|
Reminder, once the PR becomes ready for a review, use |
For now, as it's not needed.
Co-authored-by: RalfJung <post@ralfj.de>
0a10cdf to
c863a7f
Compare
|
@rustbot ready |
Split out from #165010
Adds a new
WrapMIR projection to wrap a place with a particular type constructor.Currently, the only constructor supported is
MaybeDangling, needed for #165010.MaybeUninitcould be added as another option in the future (it would be handy for safely reading union fields).r? @RalfJung