the Const::eval_bits methods don't need to be given the Ty
This commit is contained in:
parent
0692db1a90
commit
a2374e65aa
13 changed files with 35 additions and 48 deletions
|
@ -660,12 +660,12 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
|
|||
}
|
||||
_ => match ct.ty().kind() {
|
||||
ty::Int(ity) => {
|
||||
let bits = ct.eval_bits(tcx, ty::ParamEnv::reveal_all(), ct.ty());
|
||||
let bits = ct.eval_bits(tcx, ty::ParamEnv::reveal_all());
|
||||
let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128;
|
||||
write!(output, "{val}")
|
||||
}
|
||||
ty::Uint(_) => {
|
||||
let val = ct.eval_bits(tcx, ty::ParamEnv::reveal_all(), ct.ty());
|
||||
let val = ct.eval_bits(tcx, ty::ParamEnv::reveal_all());
|
||||
write!(output, "{val}")
|
||||
}
|
||||
ty::Bool => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue