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

@ -235,7 +235,9 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
neg,
}) {
Ok(c) => c,
Err(LitToConstError::Reported) => self.tcx.const_error(node.ty),
Err(LitToConstError::Reported(guar)) => {
self.tcx.const_error_with_guaranteed(node.ty, guar)
}
Err(LitToConstError::TypeError) => {
bug!("encountered type error in lit_to_const")
}