-
Notifications
You must be signed in to change notification settings - Fork 633
flow_control: Small changes in lower_if_bool_condition to align with the new code. #8085
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
fdcebc2
to
ad6a371
Compare
ed018b0
to
b694dae
Compare
ad6a371
to
f6296a6
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.
Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @liorgold2)
crates/cairo-lang-lowering/src/borrow_check/test_data/borrow_check
line 116 at r1 (raw file):
| ... | } else {} |_____________^
this is somewhat better now - right?
Code quote:
--> lib.cairo:9:5-12:13
if true {
_____^
| ...
| } else {}
|_____________^
crates/cairo-lang-lowering/src/lower/lower_if.rs
line 27 at r1 (raw file):
/// In particular, note that if `conditions` is empty, there are no conditions and the /// expression is simply [Self::expr]. pub struct ConditionedExpr<'db, 'a> {
you can probably merge lifetimes - as the conditions vector originates from the db as well.
Suggestion:
pub struct ConditionedExpr<'db> {
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @orizi)
crates/cairo-lang-lowering/src/borrow_check/test_data/borrow_check
line 116 at r1 (raw file):
Previously, orizi wrote…
this is somewhat better now - right?
Yes. In fact, this is the way it was originally (I changed it to point to the condition when I did the let-chains).
crates/cairo-lang-lowering/src/lower/lower_if.rs
line 27 at r1 (raw file):
Previously, orizi wrote…
you can probably merge lifetimes - as the conditions vector originates from the db as well.
Not sure -
this is how I create the struct:
&ConditionedExpr {
expr: expr.if_block,
conditions: &expr.conditions,
else_block: expr.else_block,
if_expr_location: ctx.get_location(expr.stable_ptr.untyped()),
},
and since conditions
is stored without a reference in expr
, the lifetime of &expr.conditions
is the same as the lifetime of expr
, which is defined as expr: &semantic::ExprIf<'db>
- so it's an anonymous lifetime and not 'db
. I haven't looked into changing this as well.
(anyway, since this file should eventually be removed, I don't want to invest too much time into it, doing it as an exercise with lifetimes)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @liorgold2)
…the new code. commit-id:97600111
f6296a6
to
a6bc71d
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.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @liorgold2)
Stack: