-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
offset_of
assertions for fields of types with interior mutability.
Implementation of `memoffset::offset_of` (from the `memoffset` crate) ends up taking a reference to a struct. In `const` contexts (such as the context of the assertion) this runs into rust-lang/rust#80384. This CL works around this by opting the generated code into `#![feature(const_refs_to_cell)]`. After this CL bindings generated by `cc_bindings_from_rs` will require a "nightly" version of the Rust compiler. This is unfortunate, but this dependency already exists on `rs_bindings_from_cc` side (e.g. requiring `impl_trait_in_assoc_type` and/or `type_alias_impl_trait` unstable features). This CL unblocks implementing `Drop` support. `Drop` support adds bindings for additional types, some of which run into this bug. PiperOrigin-RevId: 546337289 Change-Id: I1684b30a1ac096cc5115aabbe6e5c6504286947c
- Loading branch information
1 parent
aeb861f
commit d829163
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters