Suppress "erroneous constant used" for constants tainted by errors
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
This commit is contained in:
parent
2913ad6db0
commit
67f455afe1
33 changed files with 76 additions and 248 deletions
|
@ -801,7 +801,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
|
|||
span: tcx.def_span(unevaluated.def),
|
||||
unevaluated: unevaluated,
|
||||
});
|
||||
Err(ErrorHandled::Reported(reported))
|
||||
Err(ErrorHandled::Reported(reported.into()))
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ pub fn is_const_evaluatable<'tcx>(
|
|||
"Missing value for constant, but no error reported?",
|
||||
)))
|
||||
}
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e)),
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e.into())),
|
||||
Ok(_) => Ok(()),
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ pub fn is_const_evaluatable<'tcx>(
|
|||
|
||||
Err(err)
|
||||
}
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e)),
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e.into())),
|
||||
Ok(_) => Ok(()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -615,7 +615,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
|
|||
(Err(ErrorHandled::Reported(reported)), _)
|
||||
| (_, Err(ErrorHandled::Reported(reported))) => ProcessResult::Error(
|
||||
CodeSelectionError(SelectionError::NotConstEvaluatable(
|
||||
NotConstEvaluatable::Error(reported),
|
||||
NotConstEvaluatable::Error(reported.into()),
|
||||
)),
|
||||
),
|
||||
(Err(ErrorHandled::TooGeneric), _) | (_, Err(ErrorHandled::TooGeneric)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue