Pass down `extra_rustc_flag` when compiling bindings for the C++ standard library
The `bindings_for_toolchain_headers` rule that compiles the `cc_std` target
eventually calls `construct_arguments()` which reads `extra_rustc_flag`.
`extra_rustc_flag` can be used, for example, to enable Memory Sanitizer, and
thus it is critical that it is passed down to every rustc action.
PiperOrigin-RevId: 659488753
Change-Id: I5f5c630b08d6f62ebf3358efc2c283fc2f336c4d
diff --git a/rs_bindings_from_cc/bazel_support/rust_bindings_from_cc_utils.bzl b/rs_bindings_from_cc/bazel_support/rust_bindings_from_cc_utils.bzl
index 5f2a83c..86043d1 100644
--- a/rs_bindings_from_cc/bazel_support/rust_bindings_from_cc_utils.bzl
+++ b/rs_bindings_from_cc/bazel_support/rust_bindings_from_cc_utils.bzl
@@ -183,6 +183,9 @@
"_error_format": attr.label(
default = "@rules_rust//:error_format",
),
+ "_extra_rustc_flag": attr.label(
+ default = "@rules_rust//:extra_rustc_flag",
+ ),
"_extra_rustc_flags": attr.label(
default = "@rules_rust//:extra_rustc_flags",
),