Skip to content

Commit 9108294

Browse files
More rename fallout
1 parent 534e267 commit 9108294

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
@@ -2059,7 +2059,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20592059
// We currently do not store the `DefId` in the `ConstraintCategory`
20602060
// for performances reasons. The error reporting code used by NLL only
20612061
// uses the span, so this doesn't cause any problems at the moment.
2062-
Some(ObligationCauseCode::Where(CRATE_DEF_ID.to_def_id(), predicate_span))
2062+
Some(ObligationCauseCode::SpannedItem(CRATE_DEF_ID.to_def_id(), predicate_span))
20632063
} else {
20642064
None
20652065
}

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
819819
ObligationCause::new(
820820
self.span,
821821
self.body_id,
822-
ObligationCauseCode::Where(proj.def_id, pred_span),
822+
ObligationCauseCode::SpannedItem(proj.def_id, pred_span),
823823
),
824824
self.param_env,
825825
pred,
@@ -2014,7 +2014,7 @@ pub(super) fn check_type_bounds<'tcx>(
20142014
let code = if span.is_dummy() {
20152015
ObligationCauseCode::MiscItem(trait_ty.def_id)
20162016
} else {
2017-
ObligationCauseCode::Where(trait_ty.def_id, span)
2017+
ObligationCauseCode::SpannedItem(trait_ty.def_id, span)
20182018
};
20192019
ObligationCause::new(impl_ty_span, impl_ty_def_id, code)
20202020
};
@@ -2251,7 +2251,7 @@ fn try_report_async_mismatch<'tcx>(
22512251
};
22522252

22532253
for error in errors {
2254-
if let ObligationCauseCode::Where(def_id, _) = *error.root_obligation.cause.code()
2254+
if let ObligationCauseCode::SpannedItem(def_id, _) = *error.root_obligation.cause.code()
22552255
&& def_id == async_future_def_id
22562256
&& let Some(proj) = error.root_obligation.predicate.to_opt_poly_projection_pred()
22572257
&& 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
@@ -3083,14 +3083,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30833083
polarity: ty::PredicatePolarity::Positive,
30843084
}),
30853085
|derived| {
3086-
ObligationCauseCode::ImplDerived(Box::new(
3087-
traits::ImplDerivedObligationCause {
3088-
derived,
3089-
impl_or_alias_def_id: impl_def_id,
3090-
impl_def_predicate_index: Some(idx),
3091-
span,
3092-
},
3093-
))
3086+
ObligationCauseCode::ImplDerived(Box::new(traits::ImplDerivedCause {
3087+
derived,
3088+
impl_or_alias_def_id: impl_def_id,
3089+
impl_def_predicate_index: Some(idx),
3090+
span,
3091+
}))
30943092
},
30953093
)
30963094
},

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
@@ -33,7 +33,6 @@ use rustc_index::IndexVec;
3333
use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt};
3434
use rustc_infer::infer::TypeTrace;
3535
use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
36-
use rustc_middle::traits::ObligationCauseCode::ExprBindingObligation;
3736
use rustc_middle::ty::adjustment::AllowTwoPhase;
3837
use rustc_middle::ty::visit::TypeVisitableExt;
3938
use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt};
@@ -2014,7 +2013,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20142013
for (span, code) in errors_causecode {
20152014
self.dcx().try_steal_modify_and_emit_err(span, StashKey::MaybeForgetReturn, |err| {
20162015
if let Some(fn_sig) = self.body_fn_sig()
2017-
&& let ExprBindingObligation(_, _, binding_hir_id, ..) = code
2016+
&& let ObligationCauseCode::SpannedItemInExpr(_, _, binding_hir_id, ..) = code
20182017
&& !fn_sig.output().is_unit()
20192018
{
20202019
let mut block_num = 0;
@@ -2103,7 +2102,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21032102
//
21042103
// This is because due to normalization, we often register duplicate
21052104
// obligations with misc obligations that are basically impossible to
2106-
// line back up with a useful ExprBindingObligation.
2105+
// line back up with a useful SpannedItemInExpr.
21072106
for error in not_adjusted {
21082107
for (span, predicate, cause) in &remap_cause {
21092108
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
@@ -830,8 +830,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
830830
(data.impl_or_alias_def_id, data.span)
831831
}
832832
Some(
833-
ObligationCauseCode::WhereInExpr(def_id, span, _, _)
834-
| ObligationCauseCode::Where(def_id, span),
833+
ObligationCauseCode::SpannedItemInExpr(def_id, span, _, _)
834+
| ObligationCauseCode::SpannedItem(def_id, span),
835835
) => (*def_id, *span),
836836
_ => continue,
837837
};

0 commit comments

Comments
 (0)