-
Notifications
You must be signed in to change notification settings - Fork 13.3k
struct order of eval is (still) not well #23112
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
Labels
A-codegen
Area: Code generation
Comments
Oh, in case its not clear: The only reason that the struct-order-of-eval-1.rs has been passing at all is because of: zeroing-on-drop. I.e. the |
Here is a more robust way to be writing tests of order-of-evaluation: Actually store them in an event log. Demo: http://is.gd/qcBhbH |
Oh dear. ☔ |
pnkfelix
added a commit
to pnkfelix/rust
that referenced
this issue
Mar 9, 2015
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Mar 10, 2015
…komatsakis For FRU, eval field exprs (into scratch temps) before base expr Fix rust-lang#23112.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Executive summary:
This code fails in its assertion:
playpen link
Longer fun story:
You might think from our test suite that struct literal order of evaluation is being tested.
E.g. there are the two tests:
However, misbehavior I witnessed on my filling-drop work (namely,
usize
overflows, which I believe were signaled solely due to the recently landed arithmetic overflow work) led me to investigate these tests more closely.Neither of them have
assert!
norassert_eq!
calls!So essentially all we are testing in these two tests is that
I.e., Very weak testing! (And also, totally bogus dynamic semantics.)
The text was updated successfully, but these errors were encountered: