Skip to content

Commit 07a03b0

Browse files
committed
Explain that ensure_monomorphic_enough omission is intentional
1 parent 894b42c commit 07a03b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_mir/src/interpret/intrinsics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
6161
ConstValue::from_bool(tp_ty.needs_drop(tcx, param_env))
6262
}
6363
sym::min_align_of | sym::pref_align_of => {
64+
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
6465
let layout = tcx.layout_of(param_env.and(tp_ty)).map_err(|e| err_inval!(Layout(e)))?;
6566
let n = match name {
6667
sym::pref_align_of => layout.align.pref.bytes(),
@@ -74,6 +75,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
7475
ConstValue::from_u64(tcx.type_id_hash(tp_ty))
7576
}
7677
sym::variant_count => match tp_ty.kind() {
78+
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
7779
ty::Adt(ref adt, _) => ConstValue::from_machine_usize(adt.variants.len() as u64, &tcx),
7880
ty::Projection(_)
7981
| ty::Opaque(_, _)

0 commit comments

Comments
 (0)