]> git.lizzy.rs Git - rust.git/commitdiff
Add inline attributes for functions used in the query system
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Mon, 30 Mar 2020 12:36:28 +0000 (14:36 +0200)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Mon, 30 Mar 2020 12:37:44 +0000 (14:37 +0200)
src/liballoc/slice.rs
src/librustc_query_system/dep_graph/graph.rs
src/librustc_query_system/query/plumbing.rs
src/libstd/thread/local.rs

index d8fc1faca3a39c616fdd3d1a7d05ce7810c59d61..7ec99e0368ebb005539e22076f8a0c8b9c06a3de 100644 (file)
@@ -141,6 +141,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();
index 73983e1644cb01bb30e03898e3e36a98dd1da9cb..fa2b51058a3781380241e79f59e07b0d524e387f 100644 (file)
@@ -1112,6 +1112,7 @@ fn new(size: usize) -> 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,
index b371a914c6fce02304d26bd16c237862b4a91e7c..9da13f236643b72f13281a3e2461aa989f150c32 100644 (file)
@@ -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,
index 1dd942e252f6bbc9a607fff04d57eaefdca843d0..29e99c0afd27f0a3b6daa0ed049769aac322271e 100644 (file)
@@ -253,6 +253,7 @@ pub fn with<F, R>(&'static self, f: F) -> R
     /// 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,