cleanup and dedupe CTFE and Miri error reporting

This commit is contained in:
Ralf Jung 2022-11-15 12:06:20 +01:00
parent 3b91b1a37b
commit 1115ec601a
105 changed files with 724 additions and 601 deletions

View file

@ -2304,7 +2304,7 @@ impl<'tcx> ConstantKind<'tcx> {
// FIXME: We might want to have a `try_eval`-like function on `Unevaluated`
match tcx.const_eval_resolve(param_env, uneval, None) {
Ok(val) => Self::Val(val, ty),
Err(ErrorHandled::TooGeneric | ErrorHandled::Linted) => self,
Err(ErrorHandled::TooGeneric) => self,
Err(ErrorHandled::Reported(guar)) => {
Self::Ty(tcx.const_error_with_guaranteed(ty, guar))
}