about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2024-04-06 14:45:48 -0300
committerSantiago Pastorino <spastorino@gmail.com>2024-04-06 14:45:48 -0300
commit60be29bec8734e1455e2833b6cc5f5bfc0e39fa2 (patch)
tree4f3521ad1f6a5f88bf7bda897a0bd0306f553786
parent83d0a940c65e9c276308c81107b9b21cf399cbc6 (diff)
downloadrust-60be29bec8734e1455e2833b6cc5f5bfc0e39fa2.tar.gz
rust-60be29bec8734e1455e2833b6cc5f5bfc0e39fa2.zip
Add a debug asserts call to match_projection_projections to ensure invariant
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index aa4ab9c7ee9..5e9a28b5cce 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -1732,6 +1732,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         env_predicate: PolyProjectionPredicate<'tcx>,
         potentially_unnormalized_candidates: bool,
     ) -> ProjectionMatchesProjection {
+        debug_assert_eq!(obligation.predicate.def_id, env_predicate.projection_def_id());
+
         let mut nested_obligations = Vec::new();
         let infer_predicate = self.infcx.instantiate_binder_with_fresh_vars(
             obligation.cause.span,