Skip to content

Commit

Permalink
Rollup merge of #70565 - Zoxc:inlines-query-system, r=davidtwco
Browse files Browse the repository at this point in the history
Add inline attributes for functions used in the query system
  • Loading branch information
Dylan-DPC authored Apr 8, 2020
2 parents cf0432a + 87cdfb6 commit 3cae0e4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ mod hack {
use crate::string::ToString;
use crate::vec::Vec;

#[inline]
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
unsafe {
let len = b.len();
Expand Down
1 change: 1 addition & 0 deletions src/librustc_query_system/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ impl DepNodeColorMap {
DepNodeColorMap { values: (0..size).map(|_| AtomicU32::new(COMPRESSED_NONE)).collect() }
}

#[inline]
fn get(&self, index: SerializedDepNodeIndex) -> Option<DepNodeColor> {
match self.values[index].load(Ordering::Acquire) {
COMPRESSED_NONE => None,
Expand Down
1 change: 1 addition & 0 deletions src/librustc_query_system/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub struct QueryState<CTX: QueryContext, C: QueryCache> {
}

impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {
#[inline]
pub(super) fn get_lookup<'tcx>(
&'tcx self,
key: &C::Key,
Expand Down
1 change: 1 addition & 0 deletions src/libstd/thread/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ impl<T: 'static> LocalKey<T> {
/// This function will still `panic!()` if the key is uninitialized and the
/// key's initializer panics.
#[stable(feature = "thread_local_try_with", since = "1.26.0")]
#[inline]
pub fn try_with<F, R>(&'static self, f: F) -> Result<R, AccessError>
where
F: FnOnce(&T) -> R,
Expand Down

0 comments on commit 3cae0e4

Please sign in to comment.