-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Implementation of locals_used in HIR level #21262
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
Conversation
e8b8d85 to
b49e38d
Compare
fix: consider let-else expr for return control type
b49e38d to
8434be8
Compare
ChayimFriedman2
left a comment
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.
One thing: due to destructuring assignments, patterns can also refer to variables (Pat::Path). So you need to account for that.
|
Just to confirm, you mean for something like this right? fn foo() {
let mut a = 3;
let mut b = 4;
$0(a, b) = bar(1, 3);
(a, b) = bar(5, 7);$0
}
fn bar(y: u32, z: u32) -> (u32, u32) {
} |
|
Yeah, exactly. |
fix: assign mutable for variables in pattern destructing assignments
|
Thanks for confirming. I didn't knew this existed :( While doing that I found an issue, where variables inside pattern destructing assignments are not marked mutable in the generate function, so I made a fix for that as well. EDIT: Should I squash the two commits like I did before, just before merging? Please let me know? |
ChayimFriedman2
left a comment
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.
Thanks!
fixes: #21039