Skip to content

Commit

Permalink
Rollup merge of rust-lang#123559 - spastorino:match_projection_projec…
Browse files Browse the repository at this point in the history
…tions_invariant, r=compiler-errors

Add a debug asserts call to match_projection_projections to ensure invariant

Small nit as follow up of rust-lang#123471.

r? `@compiler-errors`

`@bors` rollup=always
  • Loading branch information
matthiaskrgr authored Apr 6, 2024
2 parents 0b5a8ac + 60be29b commit 7524f5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7524f5e

Please sign in to comment.