about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2020-10-15 09:07:02 +0200
committerDániel Buga <bugadani@gmail.com>2020-10-15 10:56:33 +0200
commit52ff31a7ebfab8d0b1f5d28fab917150a5f3814d (patch)
tree6ed9aa9b28ffe7c44aace5b39f82137e0fbf0295
parent5565241f65cf402c3dbcb55dd492f172c473d4ce (diff)
downloadrust-52ff31a7ebfab8d0b1f5d28fab917150a5f3814d.tar.gz
rust-52ff31a7ebfab8d0b1f5d28fab917150a5f3814d.zip
Arena: Copy cold_path and remove rustc_data_structures dependency
-rw-r--r--Cargo.lock1
-rw-r--r--compiler/rustc_arena/Cargo.toml1
-rw-r--r--compiler/rustc_arena/src/lib.rs7
3 files changed, 6 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9c48ff86769..c457e01064b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3350,7 +3350,6 @@ dependencies = [
 name = "rustc_arena"
 version = "0.0.0"
 dependencies = [
- "rustc_data_structures",
  "smallvec 1.4.2",
 ]
 
diff --git a/compiler/rustc_arena/Cargo.toml b/compiler/rustc_arena/Cargo.toml
index 41701f3255f..29caa852ed4 100644
--- a/compiler/rustc_arena/Cargo.toml
+++ b/compiler/rustc_arena/Cargo.toml
@@ -5,5 +5,4 @@ version = "0.0.0"
 edition = "2018"
 
 [dependencies]
-rustc_data_structures = { path = "../rustc_data_structures" }
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs
index 166f7f53c41..c051c607ff2 100644
--- a/compiler/rustc_arena/src/lib.rs
+++ b/compiler/rustc_arena/src/lib.rs
@@ -16,7 +16,6 @@
 #![feature(maybe_uninit_slice)]
 #![cfg_attr(test, feature(test))]
 
-use rustc_data_structures::cold_path;
 use smallvec::SmallVec;
 
 use std::alloc::Layout;
@@ -27,6 +26,12 @@ use std::mem::{self, MaybeUninit};
 use std::ptr;
 use std::slice;
 
+#[inline(never)]
+#[cold]
+pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {
+    f()
+}
+
 /// An arena that can hold objects of only one type.
 pub struct TypedArena<T> {
     /// A pointer to the next object to be allocated.