about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2017-06-13 17:11:53 +0200
committerMichael Woerister <michaelwoerister@posteo.net>2017-06-13 17:11:53 +0200
commite32365272872d9bd69dd3f89113f2a47158960c5 (patch)
treee2b36b1e3a4c60535fa0270085d4e4d71b964385
parent5b5499d5e60777b277d97efce5e62ab98c9cf823 (diff)
downloadrust-e32365272872d9bd69dd3f89113f2a47158960c5.tar.gz
rust-e32365272872d9bd69dd3f89113f2a47158960c5.zip
dep_node: Add comment about method specialization being just a performance optimization
-rw-r--r--src/librustc/dep_graph/dep_node.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs
index 787a9fb38aa..032338e4d1e 100644
--- a/src/librustc/dep_graph/dep_node.rs
+++ b/src/librustc/dep_graph/dep_node.rs
@@ -526,6 +526,9 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId,) {
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, DefId) {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
 
+    // We actually would not need to specialize the implementation of this
+    // method but it's faster to combine the hashes than to instantiate a full
+    // hashing context and stable-hashing state.
     fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
         let (def_id_0, def_id_1) = *self;
 
@@ -548,6 +551,9 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefIdList,) {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
 
+    // We actually would not need to specialize the implementation of this
+    // method but it's faster to combine the hashes than to instantiate a full
+    // hashing context and stable-hashing state.
     fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
         let mut fingerprint = Fingerprint::zero();