Convert bug
s back to delayed_bug
s.
This commit undoes some of the previous commit's mechanical changes, based on human judgment.
This commit is contained in:
parent
010f3944e0
commit
2903bbbc15
24 changed files with 87 additions and 42 deletions
|
@ -110,12 +110,12 @@ fn lit_to_mir_constant<'tcx>(
|
|||
let LitToConstInput { lit, ty, neg } = lit_input;
|
||||
let trunc = |n| {
|
||||
let param_ty = ty::ParamEnv::reveal_all().and(ty);
|
||||
let width = tcx
|
||||
.layout_of(param_ty)
|
||||
.map_err(|_| {
|
||||
let width = match tcx.layout_of(param_ty) {
|
||||
Ok(layout) => layout.size,
|
||||
Err(_) => {
|
||||
tcx.dcx().bug(format!("couldn't compute width of literal: {:?}", lit_input.lit))
|
||||
})?
|
||||
.size;
|
||||
}
|
||||
};
|
||||
trace!("trunc {} with size {} and shift {}", n, width.bits(), 128 - width.bits());
|
||||
let result = width.truncate(n);
|
||||
trace!("trunc result: {}", result);
|
||||
|
|
|
@ -12,12 +12,12 @@ pub(crate) fn lit_to_const<'tcx>(
|
|||
|
||||
let trunc = |n| {
|
||||
let param_ty = ParamEnv::reveal_all().and(ty);
|
||||
let width = tcx
|
||||
.layout_of(param_ty)
|
||||
.map_err(|_| {
|
||||
let width = match tcx.layout_of(param_ty) {
|
||||
Ok(layout) => layout.size,
|
||||
Err(_) => {
|
||||
tcx.dcx().bug(format!("couldn't compute width of literal: {:?}", lit_input.lit))
|
||||
})?
|
||||
.size;
|
||||
}
|
||||
};
|
||||
trace!("trunc {} with size {} and shift {}", n, width.bits(), 128 - width.bits());
|
||||
let result = width.truncate(n);
|
||||
trace!("trunc result: {}", result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue