-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Result depending on execution order #277
Comments
Marking as easy, but a more involved (medium difficulty) check is also possible using visitors. |
The simple cases are caught now, added list of remaining things. |
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
|
What about |
Yes, but generally it's hard to decide whether the address is dereferenced! For example,
is fine is undecidable. Similarly for closures ( |
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:
The text was updated successfully, but these errors were encountered: