Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -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");
}
Loading