Skip to content

Commit 2a996a7

Browse files
committed
Added extra hashing step.
1 parent a8f4bd0 commit 2a996a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc_trans_utils/symbol_names.rs

+7
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ fn get_symbol_hash<'a, 'tcx>(
168168
});
169169
});
170170

171+
// If this is a function, we hash the signature as well.
172+
// This is not *strictly* needed, but it may help in some
173+
// situations, see the `run-make/a-b-a-linker-guard` test.
174+
if let ty::TyFnDef(..) = item_type.sty {
175+
item_type.fn_sig(tcx).hash_stable(&mut hcx, &mut hasher);
176+
}
177+
171178
// also include any type parameters (for generic items)
172179
assert!(!substs.has_erasable_regions());
173180
assert!(!substs.needs_subst());

0 commit comments

Comments
 (0)