about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc_metadata/rmeta/encoder.rs1
-rw-r--r--src/librustc_middle/mir/mod.rs8
-rw-r--r--src/librustc_middle/mir/predecessors.rs6
-rw-r--r--src/librustc_middle/ty/query/on_disk_cache.rs1
4 files changed, 16 insertions, 0 deletions
diff --git a/src/librustc_metadata/rmeta/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs
index 9c9869c8557..b56198724db 100644
--- a/src/librustc_metadata/rmeta/encoder.rs
+++ b/src/librustc_metadata/rmeta/encoder.rs
@@ -68,6 +68,7 @@ macro_rules! encoder_methods {
 impl<'tcx> Encoder for EncodeContext<'tcx> {
     type Error = <opaque::Encoder as Encoder>::Error;
 
+    #[inline]
     fn emit_unit(&mut self) -> Result<(), Self::Error> {
         Ok(())
     }
diff --git a/src/librustc_middle/mir/mod.rs b/src/librustc_middle/mir/mod.rs
index 3295e48b7b4..ea3e59666d6 100644
--- a/src/librustc_middle/mir/mod.rs
+++ b/src/librustc_middle/mir/mod.rs
@@ -381,15 +381,18 @@ impl<'tcx> Body<'tcx> {
     }
 
     /// Returns the return type; it always return first element from `local_decls` array.
+    #[inline]
     pub fn return_ty(&self) -> Ty<'tcx> {
         self.local_decls[RETURN_PLACE].ty
     }
 
     /// Gets the location of the terminator for the given block.
+    #[inline]
     pub fn terminator_loc(&self, bb: BasicBlock) -> Location {
         Location { block: bb, statement_index: self[bb].statements.len() }
     }
 
+    #[inline]
     pub fn predecessors_for(
         &self,
         bb: BasicBlock,
@@ -398,6 +401,7 @@ impl<'tcx> Body<'tcx> {
         MappedLockGuard::map(predecessors, |preds| &mut preds[bb])
     }
 
+    #[inline]
     pub fn predecessors(&self) -> impl std::ops::Deref<Target = Predecessors> + '_ {
         self.predecessor_cache.compute(&self.basic_blocks)
     }
@@ -2639,18 +2643,21 @@ impl<'tcx> graph::DirectedGraph for Body<'tcx> {
 }
 
 impl<'tcx> graph::WithNumNodes for Body<'tcx> {
+    #[inline]
     fn num_nodes(&self) -> usize {
         self.basic_blocks.len()
     }
 }
 
 impl<'tcx> graph::WithStartNode for Body<'tcx> {
+    #[inline]
     fn start_node(&self) -> Self::Node {
         START_BLOCK
     }
 }
 
 impl<'tcx> graph::WithSuccessors for Body<'tcx> {
+    #[inline]
     fn successors(&self, node: Self::Node) -> <Self as GraphSuccessors<'_>>::Iter {
         self.basic_blocks[node].terminator().successors().cloned()
     }
@@ -2667,6 +2674,7 @@ impl graph::GraphPredecessors<'graph> for Body<'tcx> {
 }
 
 impl graph::WithPredecessors for Body<'tcx> {
+    #[inline]
     fn predecessors(&self, node: Self::Node) -> <Self as graph::GraphPredecessors<'_>>::Iter {
         self.predecessors_for(node).clone().into_iter()
     }
diff --git a/src/librustc_middle/mir/predecessors.rs b/src/librustc_middle/mir/predecessors.rs
index 90cf1e3ce4e..629b5c2efb7 100644
--- a/src/librustc_middle/mir/predecessors.rs
+++ b/src/librustc_middle/mir/predecessors.rs
@@ -15,14 +15,17 @@ pub struct PredecessorCache {
 }
 
 impl PredecessorCache {
+    #[inline]
     pub fn new() -> Self {
         PredecessorCache { cache: Lock::new(None) }
     }
 
+    #[inline]
     pub fn invalidate(&mut self) {
         *self.cache.get_mut() = None;
     }
 
+    #[inline]
     pub fn compute(
         &self,
         basic_blocks: &IndexVec<BasicBlock, BasicBlockData<'_>>,
@@ -45,18 +48,21 @@ impl PredecessorCache {
 }
 
 impl serialize::Encodable for PredecessorCache {
+    #[inline]
     fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
         serialize::Encodable::encode(&(), s)
     }
 }
 
 impl serialize::Decodable for PredecessorCache {
+    #[inline]
     fn decode<D: serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
         serialize::Decodable::decode(d).map(|_v: ()| Self::new())
     }
 }
 
 impl<CTX> HashStable<CTX> for PredecessorCache {
+    #[inline]
     fn hash_stable(&self, _: &mut CTX, _: &mut StableHasher) {
         // do nothing
     }
diff --git a/src/librustc_middle/ty/query/on_disk_cache.rs b/src/librustc_middle/ty/query/on_disk_cache.rs
index 8aecc0e698a..e9bb659d5c8 100644
--- a/src/librustc_middle/ty/query/on_disk_cache.rs
+++ b/src/librustc_middle/ty/query/on_disk_cache.rs
@@ -922,6 +922,7 @@ where
 {
     type Error = E::Error;
 
+    #[inline]
     fn emit_unit(&mut self) -> Result<(), Self::Error> {
         Ok(())
     }