about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-07-30 09:03:21 -0500
committerTrevor Gross <tmgross@umich.edu>2025-07-31 22:47:24 +0000
commitdaf353461be9c1ea0c9b70023016b150a08baaf2 (patch)
tree381978478f052006a6195cc569e89c28e0ceb271 /library
parent8d0b92acbff06a46519e012c6a171d0554e0d8ef (diff)
downloadrust-daf353461be9c1ea0c9b70023016b150a08baaf2.tar.gz
rust-daf353461be9c1ea0c9b70023016b150a08baaf2.zip
Use `core` via `rustc-std-workspace-core` in `library/panic*`
The three panic-related library crates need to have access to `core`,
and `compiler-builtins` needs to be in the crate graph. Rather than
specifying both dependencies, switch these crates to use
`rustc-std-workspace-core` which already does this.

This means there is now a single place that the `compiler-builtins`
dependency needs to get configured, for everything other than `alloc`
and `std`.
Diffstat (limited to 'library')
-rw-r--r--library/Cargo.lock9
-rw-r--r--library/panic_abort/Cargo.toml3
-rw-r--r--library/panic_unwind/Cargo.toml5
-rw-r--r--library/rustc-std-workspace-core/README.md6
-rw-r--r--library/unwind/Cargo.toml3
5 files changed, 13 insertions, 13 deletions
diff --git a/library/Cargo.lock b/library/Cargo.lock
index a9a611fe1ed..9eca0e9b050 100644
--- a/library/Cargo.lock
+++ b/library/Cargo.lock
@@ -183,9 +183,8 @@ name = "panic_abort"
 version = "0.0.0"
 dependencies = [
  "alloc",
- "compiler_builtins",
- "core",
  "libc",
+ "rustc-std-workspace-core",
 ]
 
 [[package]]
@@ -194,9 +193,8 @@ version = "0.0.0"
 dependencies = [
  "alloc",
  "cfg-if",
- "compiler_builtins",
- "core",
  "libc",
+ "rustc-std-workspace-core",
  "unwind",
 ]
 
@@ -380,9 +378,8 @@ name = "unwind"
 version = "0.0.0"
 dependencies = [
  "cfg-if",
- "compiler_builtins",
- "core",
  "libc",
+ "rustc-std-workspace-core",
  "unwinding",
 ]
 
diff --git a/library/panic_abort/Cargo.toml b/library/panic_abort/Cargo.toml
index e8c66f1a4dd..ecf043ac707 100644
--- a/library/panic_abort/Cargo.toml
+++ b/library/panic_abort/Cargo.toml
@@ -12,8 +12,7 @@ bench = false
 doc = false
 
 [dependencies]
-core = { path = "../core" }
-compiler_builtins = { path = "../compiler-builtins/compiler-builtins" }
+core = { path = "../rustc-std-workspace-core", package = "rustc-std-workspace-core" }
 
 [target.'cfg(target_os = "android")'.dependencies]
 libc = { version = "0.2", default-features = false }
diff --git a/library/panic_unwind/Cargo.toml b/library/panic_unwind/Cargo.toml
index 47914b9cd3c..13d1a7160da 100644
--- a/library/panic_unwind/Cargo.toml
+++ b/library/panic_unwind/Cargo.toml
@@ -13,10 +13,9 @@ doc = false
 
 [dependencies]
 alloc = { path = "../alloc" }
-core = { path = "../core" }
-unwind = { path = "../unwind" }
-compiler_builtins = { path = "../compiler-builtins/compiler-builtins" }
 cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
+core = { path = "../rustc-std-workspace-core", package = "rustc-std-workspace-core" }
+unwind = { path = "../unwind" }
 
 [target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
 libc = { version = "0.2", default-features = false }
diff --git a/library/rustc-std-workspace-core/README.md b/library/rustc-std-workspace-core/README.md
index 55a36e74106..15bc93f7948 100644
--- a/library/rustc-std-workspace-core/README.md
+++ b/library/rustc-std-workspace-core/README.md
@@ -11,6 +11,12 @@ on crates.io will draw a dependency edge to `libcore`, the version defined in
 this repository. That should draw all the dependency edges to ensure Cargo
 builds crates successfully!
 
+`rustc-std-workspace-core` also ensures `compiler-builtins` is in the crate
+graph. This crate is used by other crates in `library/`, other than `std` and
+`alloc`, so the `compiler-builtins` setup only needs to be configured in a
+single place. (Otherwise these crates would just need to depend on `core` and
+`compiler-builtins` separately.)
+
 Note that crates on crates.io need to depend on this crate with the name `core`
 for everything to work correctly. To do that they can use:
 
diff --git a/library/unwind/Cargo.toml b/library/unwind/Cargo.toml
index f8da09f7193..b9ce676eb3f 100644
--- a/library/unwind/Cargo.toml
+++ b/library/unwind/Cargo.toml
@@ -14,9 +14,8 @@ bench = false
 doc = false
 
 [dependencies]
-core = { path = "../core" }
-compiler_builtins = { path = "../compiler-builtins/compiler-builtins" }
 cfg-if = "1.0"
+core = { path = "../rustc-std-workspace-core", package = "rustc-std-workspace-core" }
 
 [target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
 libc = { version = "0.2.140", features = ['rustc-dep-of-std'], default-features = false }