1
Fork 0

Auto merge of #124952 - compiler-errors:no-error, r=lcnr

Rename some `FulfillmentErrorCode`/`ObligationCauseCode` variants to be less redundant

1. Rename some `FulfillmentErrorCode` variants.
2. Always use `ObligationCauseCode::` to prefix a code, rather than using a glob import and naming them through `traits::`.
3. Rename some `ObligationCauseCode` variants -- I wasn't particularly thorough with thinking of a new names for these, so could workshop them if necessary.
4. Misc stuff from renaming.

r? lcnr
This commit is contained in:
bors 2024-05-10 18:11:02 +00:00
commit 2cce088584
48 changed files with 432 additions and 393 deletions

View file

@ -1344,7 +1344,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
Applicability::MaybeIncorrect,
);
for error in errors {
if let FulfillmentErrorCode::SelectionError(
if let FulfillmentErrorCode::Select(
SelectionError::Unimplemented,
) = error.code
&& let ty::PredicateKind::Clause(ty::ClauseKind::Trait(

View file

@ -1283,7 +1283,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
}
// The type doesn't implement Clone because of unmet obligations.
for error in errors {
if let traits::FulfillmentErrorCode::SelectionError(
if let traits::FulfillmentErrorCode::Select(
traits::SelectionError::Unimplemented,
) = error.code
&& let ty::PredicateKind::Clause(ty::ClauseKind::Trait(

View file

@ -2059,7 +2059,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
// We currently do not store the `DefId` in the `ConstraintCategory`
// for performances reasons. The error reporting code used by NLL only
// uses the span, so this doesn't cause any problems at the moment.
Some(ObligationCauseCode::BindingObligation(
Some(ObligationCauseCode::SpannedWhereClause(
CRATE_DEF_ID.to_def_id(),
predicate_span,
))
@ -2067,7 +2067,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
None
}
})
.unwrap_or_else(|| ObligationCauseCode::MiscObligation);
.unwrap_or_else(|| ObligationCauseCode::Misc);
// Classify each of the constraints along the path.
let mut categorized_path: Vec<BlameConstraint<'tcx>> = path