bazel /
crubit /
ce34539f1a9575909b9f764b219eb6feeab211f7 Use `format_as_self_param...` for destructors and some constructors.
This function avoids hardcoding `&self` or `&mut self` when generating
code for `Drop::drop` or `Clone::clone`. This is done by tweaking
`generate_func` to use `format_as_self_param_for_instance_method` not
just for instance methods, but also for constructors and destructors.
As discussed earlier in chat, this CL tweaks `format_as_self_param...`
so that it keeps generating `&mut self` for destructors, even if they
are not annotated with lifetimes.
This CL is required to avoid breaking tests during a follow-up
unknown commit (deduplicating + unifying ctors/dtors/functions handling).
PiperOrigin-RevId: 421916036
1 file changed
tree: e648045788c0ca87576d723dd6c52f36a0510156
- lifetime_annotations/
- rs_bindings_from_cc/
- CODE_OF_CONDUCT
- CONTRIBUTING
- LICENSE
- README.md
README.md
Crubit: C++/Rust Bidirectional Interop Tool
Extremely experimental interop tooling for C++ and Rust.
Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.