From 52ff31a7ebfab8d0b1f5d28fab917150a5f3814d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Thu, 15 Oct 2020 09:07:02 +0200 Subject: [PATCH] Arena: Copy cold_path and remove rustc_data_structures dependency --- Cargo.lock | 1 - compiler/rustc_arena/Cargo.toml | 1 - compiler/rustc_arena/src/lib.rs | 7 ++++++- 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::ptr; use std::slice; +#[inline(never)] +#[cold] +pub fn cold_path R, R>(f: F) -> R { + f() +} + /// An arena that can hold objects of only one type. pub struct TypedArena { /// A pointer to the next object to be allocated.