From 08f033b8b73a00180955096f2c03df187f9b2060 Mon Sep 17 00:00:00 2001 From: Jason Fager Date: Fri, 25 Jul 2014 16:19:04 -0400 Subject: [PATCH] Sort trait bounds. Closes #6334 --- src/librustc/middle/typeck/collect.rs | 3 ++- src/test/run-pass/issue-6334.rs | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 780faddb886..10eeefda18e 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -1218,6 +1218,8 @@ fn ty_generics(ccx: &CrateCtxt, check_bounds_compatible(ccx.tcx, ¶m_bounds, ident, span); + param_bounds.trait_bounds.sort_by(|a,b| a.def_id.cmp(&b.def_id)); + param_bounds } @@ -1340,4 +1342,3 @@ fn check_method_self_type( _ => {} } } - diff --git a/src/test/run-pass/issue-6334.rs b/src/test/run-pass/issue-6334.rs index 98a0fa27930..67440b6ec1c 100644 --- a/src/test/run-pass/issue-6334.rs +++ b/src/test/run-pass/issue-6334.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test - // Tests that everything still compiles and runs fine even when // we reorder the bounds.