Add regression tests to ensure stable drop order#43125
Add regression tests to ensure stable drop order#43125bors merged 1 commit intorust-lang:masterfrom aochagavia:stable_drop
Conversation
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
src/test/run-pass/rfc1857.rs
Outdated
There was a problem hiding this comment.
I think this is not entirely correct. As far as I know, here the fields are dropped in reverse order of initialization (not declaration) -- that is, If you swapped the lines with x: and y: below, x would be dropped before y. I think it would be good to have tests, for structs and enum-struct variants, which use different initialization and declaration orders.
There was a problem hiding this comment.
You are right... I always confuse these terms... I am going to correct the comment and add more tests.
|
Just pushed two tests more to ensure different field initialization order behaves as expected |
|
I would consider merging this with the |
|
@arielb1 done! |
|
@bors r+ rollup |
|
📌 Commit f86e433 has been approved by |
Add regression tests to ensure stable drop order Work towards rust-lang#43034 I think this is all we need to do on the testing front regarding RFC 1857
Work towards #43034
I think this is all we need to do on the testing front regarding RFC 1857