Skip to content

Commit d18053d

Browse files
More rename fallout
1 parent 23ffdf9 commit d18053d

File tree

25 files changed

+93
-91
lines changed

25 files changed

+93
-91
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20532053
// We currently do not store the `DefId` in the `ConstraintCategory`
20542054
// for performances reasons. The error reporting code used by NLL only
20552055
// uses the span, so this doesn't cause any problems at the moment.
2056-
Some(ObligationCauseCode::Where(CRATE_DEF_ID.to_def_id(), predicate_span))
2056+
Some(ObligationCauseCode::SpannedItem(CRATE_DEF_ID.to_def_id(), predicate_span))
20572057
} else {
20582058
None
20592059
}

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
823823
ObligationCause::new(
824824
self.span,
825825
self.body_id,
826-
ObligationCauseCode::Where(proj.def_id, pred_span),
826+
ObligationCauseCode::SpannedItem(proj.def_id, pred_span),
827827
),
828828
self.param_env,
829829
pred,
@@ -2016,7 +2016,7 @@ pub(super) fn check_type_bounds<'tcx>(
20162016
let code = if span.is_dummy() {
20172017
ObligationCauseCode::MiscItem(trait_ty.def_id)
20182018
} else {
2019-
ObligationCauseCode::Where(trait_ty.def_id, span)
2019+
ObligationCauseCode::SpannedItem(trait_ty.def_id, span)
20202020
};
20212021
ObligationCause::new(impl_ty_span, impl_ty_def_id, code)
20222022
};
@@ -2253,7 +2253,7 @@ fn try_report_async_mismatch<'tcx>(
22532253
};
22542254

22552255
for error in errors {
2256-
if let ObligationCauseCode::Where(def_id, _) = *error.root_obligation.cause.code()
2256+
if let ObligationCauseCode::SpannedItem(def_id, _) = *error.root_obligation.cause.code()
22572257
&& def_id == async_future_def_id
22582258
&& let Some(proj) = error.root_obligation.predicate.to_opt_poly_projection_pred()
22592259
&& let Some(proj) = proj.no_bound_vars()

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ fn get_impl_args(
212212
traits::ObligationCause::new(
213213
impl1_span,
214214
impl1_def_id,
215-
traits::ObligationCauseCode::Where(impl2_node.def_id(), span),
215+
traits::ObligationCauseCode::SpannedItem(impl2_node.def_id(), span),
216216
)
217217
},
218218
);

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,14 +3088,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30883088
polarity: ty::PredicatePolarity::Positive,
30893089
}),
30903090
|derived| {
3091-
ObligationCauseCode::ImplDerived(Box::new(
3092-
traits::ImplDerivedObligationCause {
3093-
derived,
3094-
impl_or_alias_def_id: impl_def_id,
3095-
impl_def_predicate_index: Some(idx),
3096-
span,
3097-
},
3098-
))
3091+
ObligationCauseCode::ImplDerived(Box::new(traits::ImplDerivedCause {
3092+
derived,
3093+
impl_or_alias_def_id: impl_def_id,
3094+
impl_def_predicate_index: Some(idx),
3095+
span,
3096+
}))
30993097
},
31003098
)
31013099
},

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14151415
if span.is_dummy() {
14161416
ObligationCauseCode::MiscItemInExpr(def_id, hir_id, idx)
14171417
} else {
1418-
ObligationCauseCode::WhereInExpr(def_id, span, hir_id, idx)
1418+
ObligationCauseCode::SpannedItemInExpr(def_id, span, hir_id, idx)
14191419
}
14201420
})
14211421
}

compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1515
error: &mut traits::FulfillmentError<'tcx>,
1616
) -> bool {
1717
let (ObligationCauseCode::MiscItemInExpr(def_id, hir_id, idx)
18-
| ObligationCauseCode::WhereInExpr(def_id, _, hir_id, idx)) =
18+
| ObligationCauseCode::SpannedItemInExpr(def_id, _, hir_id, idx)) =
1919
*error.obligation.cause.code().peel_derives()
2020
else {
2121
return false;
@@ -512,7 +512,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
512512
expr: &'tcx hir::Expr<'tcx>,
513513
) -> Result<&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>> {
514514
match obligation_cause_code {
515-
traits::ObligationCauseCode::WhereInExpr(_, _, _, _) => {
515+
traits::ObligationCauseCode::SpannedItemInExpr(_, _, _, _) => {
516516
// This is the "root"; we assume that the `expr` is already pointing here.
517517
// Therefore, we return `Ok` so that this `expr` can be refined further.
518518
Ok(expr)
@@ -555,7 +555,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
555555
/// only a partial success - but it cannot be refined even further.
556556
fn blame_specific_expr_if_possible_for_derived_predicate_obligation(
557557
&self,
558-
obligation: &traits::ImplDerivedObligationCause<'tcx>,
558+
obligation: &traits::ImplDerivedCause<'tcx>,
559559
expr: &'tcx hir::Expr<'tcx>,
560560
) -> Result<&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>> {
561561
// First, we attempt to refine the `expr` for our span using the parent obligation.

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt};
3434
use rustc_infer::infer::type_variable::TypeVariableOrigin;
3535
use rustc_infer::infer::TypeTrace;
3636
use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
37-
use rustc_middle::traits::ObligationCauseCode::ExprBindingObligation;
3837
use rustc_middle::ty::adjustment::AllowTwoPhase;
3938
use rustc_middle::ty::visit::TypeVisitableExt;
4039
use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt};
@@ -2015,7 +2014,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20152014
for (span, code) in errors_causecode {
20162015
self.dcx().try_steal_modify_and_emit_err(span, StashKey::MaybeForgetReturn, |err| {
20172016
if let Some(fn_sig) = self.body_fn_sig()
2018-
&& let ExprBindingObligation(_, _, binding_hir_id, ..) = code
2017+
&& let ObligationCauseCode::SpannedItemInExpr(_, _, binding_hir_id, ..) = code
20192018
&& !fn_sig.output().is_unit()
20202019
{
20212020
let mut block_num = 0;
@@ -2104,7 +2103,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21042103
//
21052104
// This is because due to normalization, we often register duplicate
21062105
// obligations with misc obligations that are basically impossible to
2107-
// line back up with a useful ExprBindingObligation.
2106+
// line back up with a useful SpannedItemInExpr.
21082107
for error in not_adjusted {
21092108
for (span, predicate, cause) in &remap_cause {
21102109
if *predicate == error.obligation.predicate

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
567567
let code = if span.is_dummy() {
568568
ObligationCauseCode::MiscItemInExpr(def_id, self.call_expr.hir_id, idx)
569569
} else {
570-
ObligationCauseCode::WhereInExpr(def_id, span, self.call_expr.hir_id, idx)
570+
ObligationCauseCode::SpannedItemInExpr(def_id, span, self.call_expr.hir_id, idx)
571571
};
572572
traits::ObligationCause::new(self.span, self.body_id, code)
573573
},

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14081408
idx,
14091409
)
14101410
} else {
1411-
ObligationCauseCode::WhereInExpr(
1411+
ObligationCauseCode::SpannedItemInExpr(
14121412
impl_def_id,
14131413
span,
14141414
self.scope_expr_id,

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
834834
(data.impl_or_alias_def_id, data.span)
835835
}
836836
Some(
837-
ObligationCauseCode::WhereInExpr(def_id, span, _, _)
838-
| ObligationCauseCode::Where(def_id, span),
837+
ObligationCauseCode::SpannedItemInExpr(def_id, span, _, _)
838+
| ObligationCauseCode::SpannedItem(def_id, span),
839839
) => (*def_id, *span),
840840
_ => continue,
841841
};

0 commit comments

Comments
 (0)