Skip to content

Commit

Permalink
Rollup merge of rust-lang#88933 - tmiasko:remove-min-align-of, r=oli-obk
Browse files Browse the repository at this point in the history
Remove implementation of `min_align_of` intrinsic

Since rust-lang#88839 `min_align_of` is lowered to AlignOf operator.
  • Loading branch information
Manishearth committed Sep 14, 2021
2 parents e8741a3 + f9b8191 commit 5050a2f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,10 @@ crate fn eval_nullary_intrinsic<'tcx>(
ensure_monomorphic_enough(tcx, tp_ty)?;
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.
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(),
sym::min_align_of => layout.align.abi.bytes(),
_ => bug!(),
};
ConstValue::from_machine_usize(n, &tcx)
ConstValue::from_machine_usize(layout.align.pref.bytes(), &tcx)
}
sym::type_id => {
ensure_monomorphic_enough(tcx, tp_ty)?;
Expand Down

0 comments on commit 5050a2f

Please sign in to comment.