Rename const error methods for consistency
This commit is contained in:
parent
7d59fa3d23
commit
8e163f9dce
11 changed files with 24 additions and 32 deletions
|
@ -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)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue