Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk
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. Fixes #110891.
This commit is contained in:
commit
3e34be004e
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