Skip to content

Commit e323652

Browse files
dep_node: Add comment about method specialization being just a performance optimization
1 parent 5b5499d commit e323652

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc/dep_graph/dep_node.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId,) {
526526
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, DefId) {
527527
const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
528528

529+
// We actually would not need to specialize the implementation of this
530+
// method but it's faster to combine the hashes than to instantiate a full
531+
// hashing context and stable-hashing state.
529532
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
530533
let (def_id_0, def_id_1) = *self;
531534

@@ -548,6 +551,9 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
548551
impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefIdList,) {
549552
const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
550553

554+
// We actually would not need to specialize the implementation of this
555+
// method but it's faster to combine the hashes than to instantiate a full
556+
// hashing context and stable-hashing state.
551557
fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
552558
let mut fingerprint = Fingerprint::zero();
553559

0 commit comments

Comments
 (0)