Skip to content

Commit 52ff31a

Browse files
committed
Arena: Copy cold_path and remove rustc_data_structures dependency
1 parent 5565241 commit 52ff31a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3350,7 +3350,6 @@ dependencies = [
33503350
name = "rustc_arena"
33513351
version = "0.0.0"
33523352
dependencies = [
3353-
"rustc_data_structures",
33543353
"smallvec 1.4.2",
33553354
]
33563355

compiler/rustc_arena/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ version = "0.0.0"
55
edition = "2018"
66

77
[dependencies]
8-
rustc_data_structures = { path = "../rustc_data_structures" }
98
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

compiler/rustc_arena/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(maybe_uninit_slice)]
1717
#![cfg_attr(test, feature(test))]
1818

19-
use rustc_data_structures::cold_path;
2019
use smallvec::SmallVec;
2120

2221
use std::alloc::Layout;
@@ -27,6 +26,12 @@ use std::mem::{self, MaybeUninit};
2726
use std::ptr;
2827
use std::slice;
2928

29+
#[inline(never)]
30+
#[cold]
31+
pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {
32+
f()
33+
}
34+
3035
/// An arena that can hold objects of only one type.
3136
pub struct TypedArena<T> {
3237
/// A pointer to the next object to be allocated.

0 commit comments

Comments
 (0)