about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-08 23:33:40 +0200
committerGitHub <noreply@github.com>2020-04-08 23:33:40 +0200
commit3cae0e479e0b9138be9c53af178bb6eb12dfe9f1 (patch)
tree6eb3d324c60ed56e8da4c2fa7840ad74aa24a773
parentcf0432a5f59df8b9915fc1a9eba1e82b93bd16c7 (diff)
parent87cdfb6e71b0ebe3e41e04d8840a20d7428197be (diff)
downloadrust-3cae0e479e0b9138be9c53af178bb6eb12dfe9f1.tar.gz
rust-3cae0e479e0b9138be9c53af178bb6eb12dfe9f1.zip
Rollup merge of #70565 - Zoxc:inlines-query-system, r=davidtwco
Add inline attributes for functions used in the query system
-rw-r--r--src/liballoc/slice.rs1
-rw-r--r--src/librustc_query_system/dep_graph/graph.rs1
-rw-r--r--src/librustc_query_system/query/plumbing.rs1
-rw-r--r--src/libstd/thread/local.rs1
4 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index cd750d25580..4ae7532d992 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -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();
diff --git a/src/librustc_query_system/dep_graph/graph.rs b/src/librustc_query_system/dep_graph/graph.rs
index 73983e1644c..fa2b51058a3 100644
--- a/src/librustc_query_system/dep_graph/graph.rs
+++ b/src/librustc_query_system/dep_graph/graph.rs
@@ -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,
diff --git a/src/librustc_query_system/query/plumbing.rs b/src/librustc_query_system/query/plumbing.rs
index b371a914c6f..9da13f23664 100644
--- a/src/librustc_query_system/query/plumbing.rs
+++ b/src/librustc_query_system/query/plumbing.rs
@@ -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,
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 1dd942e252f..29e99c0afd2 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -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,