bazel /
crubit /
01cf3660151ebe89c744940ed3e69d1532cf9860 Remove `use memoffset_unstable_const::offset_of` from generated code.
Before this CL, Rust might warn about an unused import in the generated
`..._rs_api.rs` files. For example:
```stderr
warning: unused import: `memoffset_unstable_const::offset_of`
--> crubit/rs_bindings_from_cc/test/golden/no_elided_lifetimes_cc_rust_api.rs:10:5
|
10 | use memoffset_unstable_const::offset_of;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
```
After this CL, the generated code doesn't include the problematic import
anymore. Instead, a fully-qualified name of `offset_of` is used as
needed. This CL is similar to the earlier https://github.com/google/crubit/commit/768bba3e5255a825d7ea27d38261bb0c495e429e (which stopped
importing items from the `static_assertions` crate).
FWIW this CL seems compatible with the ideas shared on b/230665484 where
we've discussed various strategies to 1) avoid naming conflicts between
end-user code and Crubit internal code and 2) keep the generated code
human-readable.
PiperOrigin-RevId: 448348361
19 files changed