1
Fork 0

Rename const error methods for consistency

This commit is contained in:
Michael Goulet 2023-05-14 20:32:46 +00:00
parent 7d59fa3d23
commit 8e163f9dce
11 changed files with 24 additions and 32 deletions

View file

@ -2313,7 +2313,7 @@ impl<'tcx> ConstantKind<'tcx> {
if let Some(val) = c.kind().try_eval_for_mir(tcx, param_env) {
match val {
Ok(val) => Self::Val(val, c.ty()),
Err(_) => Self::Ty(tcx.const_error(self.ty())),
Err(guar) => Self::Ty(tcx.const_error(self.ty(), guar)),
}
} else {
self
@ -2325,9 +2325,7 @@ impl<'tcx> ConstantKind<'tcx> {
match tcx.const_eval_resolve(param_env, uneval, None) {
Ok(val) => Self::Val(val, ty),
Err(ErrorHandled::TooGeneric) => self,
Err(ErrorHandled::Reported(guar)) => {
Self::Ty(tcx.const_error_with_guaranteed(ty, guar))
}
Err(ErrorHandled::Reported(guar)) => Self::Ty(tcx.const_error(ty, guar)),
}
}
}