]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/sty.rs
Auto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakis
[rust.git] / src / librustc / ty / sty.rs
index cddf6dc8899691bc9bd306857705d5dedf783839..4a69fbdacc476a006051365189d339bcedc0b329 100644 (file)
@@ -496,7 +496,9 @@ pub enum ExistentialPredicate<'tcx> {
 }
 
 impl<'a, 'gcx, 'tcx> ExistentialPredicate<'tcx> {
-    pub fn cmp(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, other: &Self) -> Ordering {
+    /// Compares via an ordering that will not change if modules are reordered or other changes are
+    /// made to the tree. In particular, this ordering is preserved across incremental compilations.
+    pub fn stable_cmp(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, other: &Self) -> Ordering {
         use self::ExistentialPredicate::*;
         match (*self, *other) {
             (Trait(_), Trait(_)) => Ordering::Equal,