Store hashes in special types so they aren't accidentally encoded as numbers
This commit is contained in:
parent
de96f3d873
commit
0445fbdd83
38 changed files with 274 additions and 138 deletions
|
@ -75,7 +75,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
|
|||
}
|
||||
sym::type_id => {
|
||||
ensure_monomorphic_enough(tcx, tp_ty)?;
|
||||
ConstValue::from_u64(tcx.type_id_hash(tp_ty))
|
||||
ConstValue::from_u64(tcx.type_id_hash(tp_ty).as_u64())
|
||||
}
|
||||
sym::variant_count => match tp_ty.kind() {
|
||||
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue