From 1b94a95167bcdb6aece0eec61cd446e164b55d5e Mon Sep 17 00:00:00 2001 From: farmer_timmm <63073761+Ttimmahlax@users.noreply.github.com> Date: Fri, 28 Aug 2026 08:56:17 -0700 Subject: [PATCH 1/2] feat(alloc): claim links=rusty_alloc_global so two allocators fail at resolve time --- Cargo.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 32d13ce..e781da4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,17 @@ categories = ["memory-management", "no-std"] readme = "README.md" edition = "2021" rust-version = "1.73" +# This crate declares the `#[global_allocator]`, and a program may define exactly +# one. Cargo permits at most one package per `links` value in a dependency graph, +# so claiming a value here turns "two allocators reached the same build" into a +# RESOLVE-time error that names both packages -- instead of the multiple-symbol +# link error you get today, at the end of a long build, saying nothing about +# where either came from. +# +# The value is shared deliberately with the per-workspace seams (rzstd-alloc, and +# the others as they adopt it), because they are alternatives to this crate, not +# companions: a build wants one or the other, never both. +links = "rusty_alloc_global" [package.metadata.docs.rs] all-features = true From 5dd3b16d447ebb7e3748f5529fb164977b12d0b4 Mon Sep 17 00:00:00 2001 From: farmer_timmm <63073761+Ttimmahlax@users.noreply.github.com> Date: Fri, 28 Aug 2026 08:56:21 -0700 Subject: [PATCH 2/2] feat(alloc): claim links=rusty_alloc_global so two allocators fail at resolve time --- build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..f0afcd9 --- /dev/null +++ b/build.rs @@ -0,0 +1,10 @@ +//! Present only because Cargo requires a build script on any package that sets +//! `links`. There is nothing native to probe: the `links = "rusty_alloc_global"` +//! key exists so Cargo rejects a dependency graph holding two allocator +//! installers, which it decides at resolve time from the manifests alone. + +fn main() { + // Nothing to detect and nothing to emit. Re-run only when this file changes, + // so an empty script never invalidates the build cache. + println!("cargo:rerun-if-changed=build.rs"); +}