Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upResult depending on execution order #277
Comments
Manishearth
added
good first issue
T-AST
L-lint
labels
Sep 2, 2015
This comment has been minimized.
This comment has been minimized.
|
Marking as easy, but a more involved (medium difficulty) check is also possible using visitors. |
scurest
referenced this issue
Aug 11, 2016
Merged
Add lint for reads and writes that depend on evaluation order #1158
oli-obk
closed this
in
#1158
Aug 11, 2016
This comment has been minimized.
This comment has been minimized.
|
The simple cases are caught now, added list of remaining things. |
oli-obk
reopened this
Aug 11, 2016
oli-obk
added
the
E-medium
label
Aug 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Actually, I forgot that Rust will let you take the address of a temporary by prolonging its lifetime. So although I was thinking So to check, is there any case where a variable appears in an expression but isn't read other than
|
This comment has been minimized.
This comment has been minimized.
|
What about |
This comment has been minimized.
This comment has been minimized.
|
Yes, but generally it's hard to decide whether the address is dereferenced! For example,
is fine is undecidable. Similarly for closures ( |
llogiq commentedSep 2, 2015
•
edited by oli-obk
In Rust issue #28160, Niko shows an example containing the line
x += { x = 20; 2 }, and asks the question what execution order should be used.I think we should have a lint against those degenerate cases. However, I'm not sure what patterns we should match.
issues left: