cleanup and dedupe CTFE and Miri error reporting
This commit is contained in:
parent
3b91b1a37b
commit
1115ec601a
105 changed files with 724 additions and 601 deletions
|
@ -198,13 +198,6 @@ pub fn is_const_evaluatable<'tcx>(
|
|||
.sess
|
||||
.delay_span_bug(span, "Missing value for constant, but no error reported?"),
|
||||
)),
|
||||
Err(ErrorHandled::Linted) => {
|
||||
let reported = infcx
|
||||
.tcx
|
||||
.sess
|
||||
.delay_span_bug(span, "constant in type had error reported as lint");
|
||||
Err(NotConstEvaluatable::Error(reported))
|
||||
}
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e)),
|
||||
Ok(_) => Ok(()),
|
||||
}
|
||||
|
@ -254,11 +247,6 @@ pub fn is_const_evaluatable<'tcx>(
|
|||
|
||||
Err(err)
|
||||
},
|
||||
Err(ErrorHandled::Linted) => {
|
||||
let reported =
|
||||
infcx.tcx.sess.delay_span_bug(span, "constant in type had error reported as lint");
|
||||
Err(NotConstEvaluatable::Error(reported))
|
||||
}
|
||||
Err(ErrorHandled::Reported(e)) => Err(NotConstEvaluatable::Error(e)),
|
||||
Ok(_) => Ok(()),
|
||||
}
|
||||
|
|
|
@ -558,12 +558,6 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
|
|||
NotConstEvaluatable::Error(reported),
|
||||
)),
|
||||
),
|
||||
(Err(ErrorHandled::Linted), _) | (_, Err(ErrorHandled::Linted)) => {
|
||||
span_bug!(
|
||||
obligation.cause.span(),
|
||||
"ConstEquate: const_eval_resolve returned an unexpected error"
|
||||
)
|
||||
}
|
||||
(Err(ErrorHandled::TooGeneric), _) | (_, Err(ErrorHandled::TooGeneric)) => {
|
||||
if c1.has_non_region_infer() || c2.has_non_region_infer() {
|
||||
ProcessResult::Unchanged
|
||||
|
|
|
@ -727,12 +727,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}
|
||||
(Err(ErrorHandled::Reported(_)), _)
|
||||
| (_, Err(ErrorHandled::Reported(_))) => Ok(EvaluatedToErr),
|
||||
(Err(ErrorHandled::Linted), _) | (_, Err(ErrorHandled::Linted)) => {
|
||||
span_bug!(
|
||||
obligation.cause.span(),
|
||||
"ConstEquate: const_eval_resolve returned an unexpected error"
|
||||
)
|
||||
}
|
||||
(Err(ErrorHandled::TooGeneric), _) | (_, Err(ErrorHandled::TooGeneric)) => {
|
||||
if c1.has_non_region_infer() || c2.has_non_region_infer() {
|
||||
Ok(EvaluatedToAmbig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue