Skip to content

Commit 87cdfb6

Browse files
committed
Add inline attributes for functions used in the query system
1 parent a80ec3b commit 87cdfb6

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

src/liballoc/slice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ mod hack {
141141
use crate::string::ToString;
142142
use crate::vec::Vec;
143143

144+
#[inline]
144145
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
145146
unsafe {
146147
let len = b.len();

src/librustc_query_system/dep_graph/graph.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@ impl DepNodeColorMap {
11121112
DepNodeColorMap { values: (0..size).map(|_| AtomicU32::new(COMPRESSED_NONE)).collect() }
11131113
}
11141114

1115+
#[inline]
11151116
fn get(&self, index: SerializedDepNodeIndex) -> Option<DepNodeColor> {
11161117
match self.values[index].load(Ordering::Acquire) {
11171118
COMPRESSED_NONE => None,

src/librustc_query_system/query/plumbing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub struct QueryState<CTX: QueryContext, C: QueryCache> {
5151
}
5252

5353
impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
54+
#[inline]
5455
pub(super) fn get_lookup<'tcx>(
5556
&'tcx self,
5657
key: &C::Key,

src/libstd/thread/local.rs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl<T: 'static> LocalKey<T> {
253253
/// This function will still `panic!()` if the key is uninitialized and the
254254
/// key's initializer panics.
255255
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
256+
#[inline]
256257
pub fn try_with<F, R>(&'static self, f: F) -> Result<R, AccessError>
257258
where
258259
F: FnOnce(&T) -> R,

0 commit comments

Comments
 (0)