-
Notifications
You must be signed in to change notification settings - Fork 179
gccrs: feat: Made changes to ensure no wrong assignments are done. #3300
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
base: master
Are you sure you want to change the base?
Conversation
41640eb
to
167b909
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 changes required here i think we can get away wit this check but not totally convinced yet
Also it will need to be applied to the other assignments such as:
x +=1 etc
9bd6356
to
5748d31
Compare
fc569e4
to
2a551f5
Compare
Can you give me more information about the case we are missing as x+= 1 is valid as long as x is mutable in rust. |
1089291
to
e6a88dc
Compare
You have to adjust the visitor for |
Would probably be good to make |
c9d729f
to
caff7b1
Compare
caff7b1
to
4133278
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.
could you add a testcase like this one?
fn main() {
15 = 14;
}
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.
LGTM but i think you need to change that test case
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.
Yeah this is good but yeah arthur has some minor comments too which need done.
8a274af
to
55250bf
Compare
I guess they failing now because of newer tests. If this this merged with upstream there will not be as issue-3147.rs file is added after this changes. |
You need to rebase you code and investigate why you have failing tests. |
gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::is_lvalue): Created a function that checks for lvalue. * backend/rust-compile-base.h: Created the Signature for above function. * backend/rust-compile-expr.cc (CompileExpr::visit): Made changes to ensure proper readability and checking for wrong assignments in AssignmentExpr and CompoundAssignmentExpr Respectively. gcc/testsuite/ChangeLog: * rust/compile/issue-3297.rs: New test (New Feature). * rust/compile/issue-3297-2.rs: New test (Regression). * rust/compile/issue-3297-3.rs: New test (New Feature). Signed-off-by: Sri Ganesh Thota <[email protected]>
55250bf
to
e8f8dbc
Compare
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog:
Fixes #3287
make check-rust
passes locallyclang-format
gcc/testsuite/rust/