Skip to content

Commit

Permalink
Drive-by cleanup: use .is_sorted() instead of implementing it by hand
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Mar 15, 2023
1 parent 6d67b09 commit 82fd36f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#![feature(result_option_inspect)]
#![feature(const_option)]
#![feature(trait_alias)]
#![feature(is_sorted)]
#![recursion_limit = "512"]
#![allow(rustc::potential_query_instability)]

Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_middle/src/ty/context/mk.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(rustc::usage_of_ty_tykind)]

use std::cmp::Ordering;
use std::iter;

use rustc_error_messages::MultiSpan;
Expand Down Expand Up @@ -547,9 +546,7 @@ impl<'tcx> MkCtxt<'tcx> {
) -> &'tcx List<PolyExistentialPredicate<'tcx>> {
assert!(!eps.is_empty());
assert!(
eps.array_windows()
.all(|[a, b]| a.skip_binder().stable_cmp(self.tcx, &b.skip_binder())
!= Ordering::Greater)
eps.is_sorted_by(|a, b| Some(a.skip_binder().stable_cmp(self.tcx, &b.skip_binder())))
);
self.tcx.intern_poly_existential_predicates(eps)
}
Expand Down

0 comments on commit 82fd36f

Please sign in to comment.