Add inline attributes for functions used in the query system
This commit is contained in:
parent
a80ec3b3b1
commit
87cdfb6e71
|
@ -141,6 +141,7 @@ mod hack {
|
||||||
use crate::string::ToString;
|
use crate::string::ToString;
|
||||||
use crate::vec::Vec;
|
use crate::vec::Vec;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
|
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let len = b.len();
|
let len = b.len();
|
||||||
|
|
|
@ -1112,6 +1112,7 @@ impl DepNodeColorMap {
|
||||||
DepNodeColorMap { values: (0..size).map(|_| AtomicU32::new(COMPRESSED_NONE)).collect() }
|
DepNodeColorMap { values: (0..size).map(|_| AtomicU32::new(COMPRESSED_NONE)).collect() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn get(&self, index: SerializedDepNodeIndex) -> Option<DepNodeColor> {
|
fn get(&self, index: SerializedDepNodeIndex) -> Option<DepNodeColor> {
|
||||||
match self.values[index].load(Ordering::Acquire) {
|
match self.values[index].load(Ordering::Acquire) {
|
||||||
COMPRESSED_NONE => None,
|
COMPRESSED_NONE => None,
|
||||||
|
|
|
@ -51,6 +51,7 @@ pub struct QueryState<CTX: QueryContext, C: QueryCache> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
|
impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
|
||||||
|
#[inline]
|
||||||
pub(super) fn get_lookup<'tcx>(
|
pub(super) fn get_lookup<'tcx>(
|
||||||
&'tcx self,
|
&'tcx self,
|
||||||
key: &C::Key,
|
key: &C::Key,
|
||||||
|
|
|
@ -253,6 +253,7 @@ impl<T: 'static> LocalKey<T> {
|
||||||
/// This function will still `panic!()` if the key is uninitialized and the
|
/// This function will still `panic!()` if the key is uninitialized and the
|
||||||
/// key's initializer panics.
|
/// key's initializer panics.
|
||||||
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
|
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
|
||||||
|
#[inline]
|
||||||
pub fn try_with<F, R>(&'static self, f: F) -> Result<R, AccessError>
|
pub fn try_with<F, R>(&'static self, f: F) -> Result<R, AccessError>
|
||||||
where
|
where
|
||||||
F: FnOnce(&T) -> R,
|
F: FnOnce(&T) -> R,
|
||||||
|
|
Loading…
Reference in New Issue