skip const eval if we have an error in borrowck

This commit is contained in:
Michael Goulet
2022-02-06 12:16:49 -08:00
parent 4ad272b282
commit 77dae2d25d
3 changed files with 22 additions and 2 deletions

View File

@@ -287,6 +287,9 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
if let Some(error_reported) = tcx.typeck_opt_const_arg(def).tainted_by_errors {
return Err(ErrorHandled::Reported(error_reported));
}
if tcx.mir_borrowck_opt_const_arg(def).tainted_by_errors {
return Err(ErrorHandled::Reported(ErrorReported {}));
}
}
if !tcx.is_mir_available(def.did) {
tcx.sess.delay_span_bug(