diff options
| author | bors <bors@rust-lang.org> | 2024-05-10 18:11:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-10 18:11:02 +0000 |
| commit | 2cce0885840cd171cb3a8677af795d0abd2dc77c (patch) | |
| tree | 092dca92988edeae15f1903d06eb1dd3ea2aa045 /compiler/rustc_borrowck/src | |
| parent | 6a19a87097fbf430d0fe09e15d9266a990c1e0f6 (diff) | |
| parent | 6f77bfe8b63b2e1bba71a0eb4973ccd17fe8885c (diff) | |
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
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/region_infer/mod.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 0b4018a23ce..88172c62a3b 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -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( diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 9631c7de9ff..c9a09c19ce6 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -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( diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index 27933536166..e58723c2ec9 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -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 |
