Skip to content

Commit

Permalink
Add inlining.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Apr 28, 2020
1 parent e333277 commit d7d2185
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_query_system/query/caches.rs
Expand Up @@ -80,6 +80,7 @@ impl<K: Eq + Hash, V: Clone> QueryStorage for DefaultCache<K, V> {
type Value = V;
type Stored = V;

#[inline]
fn store_nocache(&self, value: Self::Value) -> Self::Stored {
// We have no dedicated storage
value
Expand Down Expand Up @@ -157,6 +158,7 @@ impl<'tcx, K: Eq + Hash, V: 'tcx> QueryStorage for ArenaCache<'tcx, K, V> {
type Value = V;
type Stored = &'tcx V;

#[inline]
fn store_nocache(&self, value: Self::Value) -> Self::Stored {
let value = self.arena.alloc((value, DepNodeIndex::INVALID));
let value = unsafe { &*(&value.0 as *const _) };
Expand Down

0 comments on commit d7d2185

Please sign in to comment.