-
Notifications
You must be signed in to change notification settings - Fork 0
Handle patterns within closures #45
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
arora-aman
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.
Just things that I feel need to chage. Will do nits later
194b37d to
cadf23b
Compare
cadf23b to
92ae1ce
Compare
92ae1ce to
5f854d3
Compare
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.
There are two fake read causes. One ForLet and one ForMatch. We probably should capture the correct one. I don't think it will be too much work to do that, but I think if this works fine for now, we should delay that until we fix bugs/ we get close to getting this to work.
751a599 to
84157b4
Compare
src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns-1.rs
Outdated
Show resolved
Hide resolved
523a104 to
31e3451
Compare
arora-aman
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.
initial set of comments
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.
Did you get a chance to try HashSet, because in case of
let c = || {
let (t1, _) = t;
let (_, t2) = t;
}we will introduce 2 fake reads, when one should suffice
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.
Note to self: Read this logic properly
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.
is this needed?
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.
Yes,
error[E0603]: module `as_place` is private
--> compiler/rustc_mir_build/src/build/mod.rs:2:25
|
2 | use crate::build::expr::as_place::PlaceBuilder;
| ^^^^^^^^ private module
|
note: the module `as_place` is defined here
--> compiler/rustc_mir_build/src/build/expr/mod.rs:65:1
|
65 | mod as_place;
| ^^^^^^^^^^^^^
error[E0603]: module `as_place` is private
--> compiler/rustc_mir_build/src/build/matches/mod.rs:8:25
|
8 | use crate::build::expr::as_place::PlaceBuilder;
| ^^^^^^^^ private module
|
note: the module `as_place` is defined here
--> compiler/rustc_mir_build/src/build/expr/mod.rs:65:1
|
65 | mod as_place;
| ^^^^^^^^^^^^^
error[E0603]: module `as_place` is private
--> compiler/rustc_mir_build/src/build/matches/simplify.rs:15:25
|
15 | use crate::build::expr::as_place::PlaceBuilder;
| ^^^^^^^^ private module
|
note: the module `as_place` is defined here
--> compiler/rustc_mir_build/src/build/expr/mod.rs:65:1
|
65 | mod as_place;
| ^^^^^^^^^^^^^
error[E0603]: module `as_place` is private
--> compiler/rustc_mir_build/src/build/matches/test.rs:8:25
|
8 | use crate::build::expr::as_place::PlaceBuilder;
| ^^^^^^^^ private module
|
note: the module `as_place` is defined here
--> compiler/rustc_mir_build/src/build/expr/mod.rs:65:1
|
65 | mod as_place;
| ^^^^^^^^^^^^^
error[E0603]: module `as_place` is private
--> compiler/rustc_mir_build/src/build/matches/util.rs:1:25
|
1 | use crate::build::expr::as_place::PlaceBuilder;
| ^^^^^^^^ private module
|
note: the module `as_place` is defined here
--> compiler/rustc_mir_build/src/build/expr/mod.rs:65:1
|
65 | mod as_place;
| ^^^^^^^^^^^^^
error: aborting due to 5 previous errors
|
Opened PR on rust-lang rust-lang#82536 |
d566cb4 to
9aca998
Compare
06ff810 to
459ebf8
Compare
459ebf8 to
88de9c2
Compare
88de9c2 to
189d206
Compare
Using the following test:
The relevant log output is as follows: