diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-26 12:03:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 12:03:43 -0500 |
| commit | 479de1f7f2b969d481cb253269aa9de25f5c736a (patch) | |
| tree | b2286aae889705a2d6a62778c5513d5ba11865d5 | |
| parent | 3e1a08925744cfcf1a211c1257f2b44f31e6be46 (diff) | |
| parent | b5fc3a10d37460f4df4e90be7d76b52acadd677c (diff) | |
| download | rust-479de1f7f2b969d481cb253269aa9de25f5c736a.tar.gz rust-479de1f7f2b969d481cb253269aa9de25f5c736a.zip | |
Rollup merge of #133362 - compiler-errors:existential-preds, r=BoxyUwU
No need to re-sort existential preds in relate impl We already assert that these predicates are in the right ordering in `mk_poly_existential_predicates`. r? types
| -rw-r--r-- | compiler/rustc_middle/src/ty/relate.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs index b06687490d2..afdec7a86d4 100644 --- a/compiler/rustc_middle/src/ty/relate.rs +++ b/compiler/rustc_middle/src/ty/relate.rs @@ -3,7 +3,6 @@ use std::iter; pub use rustc_type_ir::relate::*; use crate::ty::error::{ExpectedFound, TypeError}; -use crate::ty::predicate::ExistentialPredicateStableCmpExt as _; use crate::ty::{self as ty, Ty, TyCtxt}; pub type RelateResult<'tcx, T> = rustc_type_ir::relate::RelateResult<TyCtxt<'tcx>, T>; @@ -86,10 +85,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for &'tcx ty::List<ty::PolyExistentialPredicate< // in `a`. let mut a_v: Vec<_> = a.into_iter().collect(); let mut b_v: Vec<_> = b.into_iter().collect(); - // `skip_binder` here is okay because `stable_cmp` doesn't look at binders - a_v.sort_by(|a, b| a.skip_binder().stable_cmp(tcx, &b.skip_binder())); a_v.dedup(); - b_v.sort_by(|a, b| a.skip_binder().stable_cmp(tcx, &b.skip_binder())); b_v.dedup(); if a_v.len() != b_v.len() { return Err(TypeError::ExistentialMismatch(ExpectedFound::new(a, b))); |
