diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-03 16:07:26 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-03 16:08:57 +0200 |
| commit | b2ed9c4007767f6cf692229cffd471d4ce5fde55 (patch) | |
| tree | b3f600b6f3282ab00d51ee51932154d8da21f6f7 /compiler/rustc_query_system/src | |
| parent | 48ae6ec4f343745d94f5fc2cc7a0b7a085cb6c40 (diff) | |
| download | rust-b2ed9c4007767f6cf692229cffd471d4ce5fde55.tar.gz rust-b2ed9c4007767f6cf692229cffd471d4ce5fde55.zip | |
Add some inlining.
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/ich/hcx.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/ich/impls_hir.rs | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs index d3e5189ce76..f2e935c59fc 100644 --- a/compiler/rustc_query_system/src/ich/hcx.rs +++ b/compiler/rustc_query_system/src/ich/hcx.rs @@ -178,12 +178,14 @@ impl<'a> StableHashingContext<'a> { } impl<'a> HashStable<StableHashingContext<'a>> for ast::NodeId { + #[inline] fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) { panic!("Node IDs should not appear in incremental state"); } } impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { + #[inline] fn hash_spans(&self) -> bool { self.hash_spans } @@ -198,6 +200,7 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { self.definitions.def_span(def_id) } + #[inline] fn span_data_to_lines_and_cols( &mut self, span: &SpanData, diff --git a/compiler/rustc_query_system/src/ich/impls_hir.rs b/compiler/rustc_query_system/src/ich/impls_hir.rs index 3c3e7e0d173..04eb263a977 100644 --- a/compiler/rustc_query_system/src/ich/impls_hir.rs +++ b/compiler/rustc_query_system/src/ich/impls_hir.rs @@ -26,6 +26,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { } } + #[inline] fn hash_body_id(&mut self, id: hir::BodyId, hasher: &mut StableHasher) { let hcx = self; if hcx.hash_bodies() { @@ -33,6 +34,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { } } + #[inline] fn hash_reference_to_item(&mut self, id: hir::HirId, hasher: &mut StableHasher) { let hcx = self; @@ -41,6 +43,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { }) } + #[inline] fn hash_hir_mod(&mut self, module: &hir::Mod<'_>, hasher: &mut StableHasher) { let hcx = self; let hir::Mod { inner: ref inner_span, ref item_ids } = *module; @@ -103,6 +106,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { } } + #[inline] fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F) { let prev_hash_node_ids = self.node_id_hashing_mode; self.node_id_hashing_mode = NodeIdHashingMode::Ignore; @@ -114,6 +118,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { } impl<'a> HashStable<StableHashingContext<'a>> for hir::Body<'_> { + #[inline] fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { let hir::Body { params, value, generator_kind } = self; |
