1
Fork 0

Use error constant instead of explicit error handling

This commit is contained in:
Oli Scherer 2025-01-07 12:03:28 +00:00
parent 7833cf7a47
commit 787af97bab
5 changed files with 3 additions and 10 deletions

View file

@ -120,7 +120,6 @@ 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)) => ty::Const::new_error(tcx, guar),
Err(LitToConstError::TypeError) => {
bug!("encountered type error in lit_to_const")
}