1
Fork 0

Use const_error_with_guaranteed more

This commit is contained in:
Michael Goulet 2022-11-10 05:39:06 +00:00
parent 34115d040b
commit 0f89fb1791
7 changed files with 51 additions and 15 deletions

View file

@ -2251,7 +2251,9 @@ impl<'tcx> ConstantKind<'tcx> {
match tcx.const_eval_resolve(param_env, uneval, None) {
Ok(val) => Self::Val(val, ty),
Err(ErrorHandled::TooGeneric | ErrorHandled::Linted) => self,
Err(_) => Self::Ty(tcx.const_error(ty)),
Err(ErrorHandled::Reported(guar)) => {
Self::Ty(tcx.const_error_with_guaranteed(ty, guar))
}
}
}
}