Replace const_error methods with Const::new_error

This commit is contained in:
Boxy 2023-07-04 14:46:32 +01:00
parent ddbc774e74
commit d30f56dbf2
15 changed files with 66 additions and 59 deletions

View file

@ -119,7 +119,7 @@ fn recurse_build<'tcx>(
let sp = node.span;
match tcx.at(sp).lit_to_const(LitToConstInput { lit: &lit.node, ty: node.ty, neg }) {
Ok(c) => c,
Err(LitToConstError::Reported(guar)) => tcx.const_error(node.ty, guar),
Err(LitToConstError::Reported(guar)) => ty::Const::new_error(tcx, guar, node.ty),
Err(LitToConstError::TypeError) => {
bug!("encountered type error in lit_to_const")
}