about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-05-09 21:18:48 -0400
committerMichael Goulet <michael@errs.io>2024-05-10 10:42:57 -0400
commit6f77bfe8b63b2e1bba71a0eb4973ccd17fe8885c (patch)
tree4ed62ab743c67875b1e4adcdff26e05766faa926 /compiler/rustc_hir_analysis/src
parent9108294a6c37c36ce561eade9d1c321a5d75bddd (diff)
downloadrust-6f77bfe8b63b2e1bba71a0eb4973ccd17fe8885c.tar.gz
rust-6f77bfe8b63b2e1bba71a0eb4973ccd17fe8885c.zip
Name tweaks
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/check/compare_impl_item.rs9
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs2
3 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
index 00f223f2ca3..b2b82670d8b 100644
--- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
+++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
@@ -819,7 +819,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
                     ObligationCause::new(
                         self.span,
                         self.body_id,
-                        ObligationCauseCode::SpannedItem(proj.def_id, pred_span),
+                        ObligationCauseCode::SpannedWhereClause(proj.def_id, pred_span),
                     ),
                     self.param_env,
                     pred,
@@ -2012,9 +2012,9 @@ pub(super) fn check_type_bounds<'tcx>(
     );
     let mk_cause = |span: Span| {
         let code = if span.is_dummy() {
-            ObligationCauseCode::MiscItem(trait_ty.def_id)
+            ObligationCauseCode::WhereClause(trait_ty.def_id)
         } else {
-            ObligationCauseCode::SpannedItem(trait_ty.def_id, span)
+            ObligationCauseCode::SpannedWhereClause(trait_ty.def_id, span)
         };
         ObligationCause::new(impl_ty_span, impl_ty_def_id, code)
     };
@@ -2251,7 +2251,8 @@ fn try_report_async_mismatch<'tcx>(
     };
 
     for error in errors {
-        if let ObligationCauseCode::SpannedItem(def_id, _) = *error.root_obligation.cause.code()
+        if let ObligationCauseCode::SpannedWhereClause(def_id, _) =
+            *error.root_obligation.cause.code()
             && def_id == async_future_def_id
             && let Some(proj) = error.root_obligation.predicate.to_opt_poly_projection_pred()
             && let Some(proj) = proj.no_bound_vars()
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index 49d4b8ecfe7..0578317f914 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -1550,7 +1550,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
             let cause = traits::ObligationCause::new(
                 sp,
                 wfcx.body_def_id,
-                ObligationCauseCode::MiscItem(def_id.to_def_id()),
+                ObligationCauseCode::WhereClause(def_id.to_def_id()),
             );
             traits::Obligation::new(tcx, cause, wfcx.param_env, pred)
         });
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
index 77dbb23fcb6..de697b04ebf 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
@@ -212,7 +212,7 @@ fn get_impl_args(
             traits::ObligationCause::new(
                 impl1_span,
                 impl1_def_id,
-                traits::ObligationCauseCode::SpannedItem(impl2_node.def_id(), span),
+                traits::ObligationCauseCode::SpannedWhereClause(impl2_node.def_id(), span),
             )
         },
     );