Explain that ensure_monomorphic_enough
omission is intentional
This commit is contained in:
parent
894b42c861
commit
07a03b0a58
1 changed files with 2 additions and 0 deletions
|
@ -61,6 +61,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
|
|||
ConstValue::from_bool(tp_ty.needs_drop(tcx, param_env))
|
||||
}
|
||||
sym::min_align_of | sym::pref_align_of => {
|
||||
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
|
||||
let layout = tcx.layout_of(param_env.and(tp_ty)).map_err(|e| err_inval!(Layout(e)))?;
|
||||
let n = match name {
|
||||
sym::pref_align_of => layout.align.pref.bytes(),
|
||||
|
@ -74,6 +75,7 @@ crate fn eval_nullary_intrinsic<'tcx>(
|
|||
ConstValue::from_u64(tcx.type_id_hash(tp_ty))
|
||||
}
|
||||
sym::variant_count => match tp_ty.kind() {
|
||||
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
|
||||
ty::Adt(ref adt, _) => ConstValue::from_machine_usize(adt.variants.len() as u64, &tcx),
|
||||
ty::Projection(_)
|
||||
| ty::Opaque(_, _)
|
||||
|
|
Loading…
Reference in a new issue