Skip to content

Commit 12fdd42

Browse files
committed
pr-msg
1 parent ee38a2c commit 12fdd42

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pr-msg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
deref patterns: lower deref patterns to MIR
2+
3+
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. This runs into two complications: false edges and fake borrows.
4+
5+
False edges were handled in https://github.com/rust-lang/rust/pull/123324.
6+
7+
Fake borrows are special borrows we take before running each match guard to prevent it from mutating the match scrutineen in ways that could affect other match arms. With deref patterns, the fake borrows could refer to places inside our temporaries, which wouldn't be initialized in other branches. To solve this I skip any fake borrows that aren't subplaces of the match scrutinee. I'm not fully confident this is correct yet.
8+
9+
I'll handle mutability (enabled by https://github.com/rust-lang/rust/pull/122835) in a separate PR.

0 commit comments

Comments
 (0)