Rollup merge of #88933 - tmiasko:remove-min-align-of, r=oli-obk
Remove implementation of `min_align_of` intrinsic Since #88839 `min_align_of` is lowered to AlignOf operator.
This commit is contained in:
commit
d11ee806a4
1 changed files with 2 additions and 7 deletions
|
@ -62,15 +62,10 @@ crate fn eval_nullary_intrinsic<'tcx>(
|
||||||
ensure_monomorphic_enough(tcx, tp_ty)?;
|
ensure_monomorphic_enough(tcx, tp_ty)?;
|
||||||
ConstValue::from_bool(tp_ty.needs_drop(tcx, param_env))
|
ConstValue::from_bool(tp_ty.needs_drop(tcx, param_env))
|
||||||
}
|
}
|
||||||
sym::min_align_of | sym::pref_align_of => {
|
sym::pref_align_of => {
|
||||||
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
|
// 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 layout = tcx.layout_of(param_env.and(tp_ty)).map_err(|e| err_inval!(Layout(e)))?;
|
||||||
let n = match name {
|
ConstValue::from_machine_usize(layout.align.pref.bytes(), &tcx)
|
||||||
sym::pref_align_of => layout.align.pref.bytes(),
|
|
||||||
sym::min_align_of => layout.align.abi.bytes(),
|
|
||||||
_ => bug!(),
|
|
||||||
};
|
|
||||||
ConstValue::from_machine_usize(n, &tcx)
|
|
||||||
}
|
}
|
||||||
sym::type_id => {
|
sym::type_id => {
|
||||||
ensure_monomorphic_enough(tcx, tp_ty)?;
|
ensure_monomorphic_enough(tcx, tp_ty)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue