rework borrowck errors so that it's harder to not set tainted
This commit is contained in:
parent
8b7b0a0e49
commit
29c2bb51c0
7 changed files with 119 additions and 74 deletions
|
@ -287,8 +287,8 @@ 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 let Some(error_reported) = tcx.mir_borrowck_opt_const_arg(def).tainted_by_errors {
|
||||
return Err(ErrorHandled::Reported(error_reported));
|
||||
}
|
||||
}
|
||||
if !tcx.is_mir_available(def.did) {
|
||||
|
|
|
@ -516,8 +516,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
if let Some(error_reported) = self.tcx.typeck_opt_const_arg(def).tainted_by_errors {
|
||||
throw_inval!(AlreadyReported(error_reported));
|
||||
}
|
||||
if self.tcx.mir_borrowck_opt_const_arg(def).tainted_by_errors {
|
||||
throw_inval!(AlreadyReported(rustc_errors::ErrorReported {}));
|
||||
if let Some(error_reported) =
|
||||
self.tcx.mir_borrowck_opt_const_arg(def).tainted_by_errors
|
||||
{
|
||||
throw_inval!(AlreadyReported(error_reported));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue