Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: How to prevent an unused field to be optimized by compiler?
I have a struct that contains a field which is a handle to something else.
I use this handle to keep the resource from being dropped, but my code does not use that field.
But I found that in the release build, this field is optimized away by the compiler. What's the recommended way to resolve this?
5 posts - 4 participants
🏷️ rust_feed