Crubit OSS: Don't add `//common:rust_allocator_shims` to `deps` of targets, add it as `rust_toolchain.allocator_library`.
`rust_binary.experimental_use_cc_common_link` has the default value of -1 for OSS targets, which means the decision is deferred to `rust_toolchain.experimental_use_cc_common_link`, which is False by default. For rust_* targets, since rustc performs the final linking, `rust_allocator_shims` shouldn't be necessary.
For cc_* targets that link in Rust code, rustc doesn't perform the final linking, and therefore these targets need `rust_allocator_shims`. Add this target as `rust_toolchain.allocator_library` to avoid having to manually add it to cc_* targets.
PiperOrigin-RevId: 551553185
Change-Id: Id626cb06526f639964044acd7fdda871ae4fd316
diff --git a/WORKSPACE b/WORKSPACE
index 2d83031..a8d453b 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -45,6 +45,7 @@
versions = [
RUST_TOOLCHAIN_VERSION,
],
+ allocator_library = "@//common:rust_allocator_shims",
dev_components = True,
)