deref patterns: lower deref patterns to MIR#122598
Merged
bors merged 10 commits intorust-lang:masterfrom Apr 23, 2024
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
ebb769b to
6c39107
Compare
This comment has been minimized.
This comment has been minimized.
6c39107 to
ee9ff2f
Compare
This comment has been minimized.
This comment has been minimized.
ee9ff2f to
07e4549
Compare
Member
Author
|
cc @fee1-dead @BoxyUwU if you're curious |
This comment was marked as resolved.
This comment was marked as resolved.
07e4549 to
b1499a5
Compare
This comment has been minimized.
This comment has been minimized.
b1499a5 to
03d616b
Compare
This comment has been minimized.
This comment has been minimized.
03d616b to
8a73cab
Compare
6 tasks
ab5b542 to
2e22b35
Compare
Member
Author
|
This is ready! @rustbot ready |
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras This PR changes Stable MIR |
Member
Author
|
The only sensible solution I found to solve the fake borrows issue is to add non-shallow fake borrows to MIR and use that. That's a nontrivial change though. |
Nadrieril
commented
Apr 7, 2024
Nadrieril
commented
Apr 7, 2024
aa4fce2 to
91751db
Compare
91751db to
16793d6
Compare
Collaborator
|
☔ The latest upstream changes (presumably #123991) made this pull request unmergeable. Please resolve the merge conflicts. |
This handles using deref patterns to choose the correct match arm. This does not handle bindings or guards. Co-authored-by: Deadbeef <ent3rm4n@gmail.com>
16793d6 to
726fb55
Compare
Contributor
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 23, 2024
Rollup of 7 pull requests Successful merges: - rust-lang#120929 (Wrap dyn type with parentheses in suggestion) - rust-lang#122591 (Suggest using type args directly instead of equality constraint) - rust-lang#122598 (deref patterns: lower deref patterns to MIR) - rust-lang#123048 (alloc::Layout: explicitly document size invariant on the type level) - rust-lang#123993 (Do `check_coroutine_obligations` once per typeck root) - rust-lang#124218 (Allow nesting subdiagnostics in #[derive(Subdiagnostic)]) - rust-lang#124285 (Mark ``@RUSTC_BUILTIN`` search path usage as unstable) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 23, 2024
Rollup merge of rust-lang#122598 - Nadrieril:full-derefpats, r=matthewjasper deref patterns: lower deref patterns to MIR This lowers deref patterns to MIR. This is a bit tricky because this is the first kind of pattern that requires storing a value in a temporary. Thanks to rust-lang#123324 false edges are no longer a problem. The thing I'm not confident about is the handling of fake borrows. This PR ignores any fake borrows inside a deref pattern. We are guaranteed to at least fake borrow the place of the first pointer value, which could be enough, but I'm not certain.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This lowers deref patterns to MIR. This is a bit tricky because this is the first kind of pattern that requires storing a value in a temporary. Thanks to #123324 false edges are no longer a problem.
The thing I'm not confident about is the handling of fake borrows. This PR ignores any fake borrows inside a deref pattern. We are guaranteed to at least fake borrow the place of the first pointer value, which could be enough, but I'm not certain.