about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-12-24 14:10:55 -0800
committerEsteban Küber <esteban@kuber.com.ar>2019-12-25 11:12:56 -0800
commit621d7e959b24ea8640584f0ced13ec016be35d16 (patch)
tree7d3cf301a7e0e5aa9c624625f5a56a8762267df7 /src
parent93fb219579b3c012dbef7594b676f62070cd666e (diff)
downloadrust-621d7e959b24ea8640584f0ced13ec016be35d16.tar.gz
rust-621d7e959b24ea8640584f0ced13ec016be35d16.zip
Fix rebase and sort assoc type list for deterministic output
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/astconv.rs2
-rw-r--r--src/test/compile-fail/issue-23595-1.rs2
-rw-r--r--src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs6
-rw-r--r--src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr8
-rw-r--r--src/test/ui/associated-types/missing-associated-types.stderr18
-rw-r--r--src/test/ui/issues/issue-22560.stderr4
6 files changed, 21 insertions, 19 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 8f6940cc0ce..d28af783c0b 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1686,6 +1686,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             },
             _ => {}
         }
+        names.sort();
+        trait_bound_spans.sort();
         let mut err = struct_span_err!(
             tcx.sess,
             trait_bound_spans,
diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/compile-fail/issue-23595-1.rs
index 1970b9af14e..483c205f42d 100644
--- a/src/test/compile-fail/issue-23595-1.rs
+++ b/src/test/compile-fail/issue-23595-1.rs
@@ -6,7 +6,7 @@ trait Hierarchy {
     type Value;
     type ChildKey;
     type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>;
-    //~^ ERROR: the value of the associated types `Value` (from trait `Hierarchy`), `ChildKey`
+    //~^ ERROR: the value of the associated types
 
     fn data(&self) -> Option<(Self::Value, Self::Children)>;
 }
diff --git a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs
index 77ed784f1fa..df19332b645 100644
--- a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs
+++ b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs
@@ -22,7 +22,7 @@ fn dent<C:BoxCar>(c: C, color: C::Color) {
 
 fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
     //~^ ERROR ambiguous associated type
-    //~| ERROR the value of the associated types `Color` (from trait `Vehicle`), `Color` (from
+    //~| ERROR the value of the associated types
 }
 
 fn paint<C:BoxCar>(c: C, d: C::Color) {
@@ -30,8 +30,8 @@ fn paint<C:BoxCar>(c: C, d: C::Color) {
 }
 
 fn dent_object_2<COLOR>(c: dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
-    //~^ ERROR the value of the associated types `Color` (from trait `Vehicle`), `Color` (from
-    //~| ERROR equality constraints are not yet supported in where clauses
+    //~^ ERROR the value of the associated types
+    //~| ERROR equality constraints are not yet supported in `where` clauses
 }
 
 fn dent_object_3<X, COLOR>(c: X)
diff --git a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
index 8eb296d4998..c60d5f8f2c8 100644
--- a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
+++ b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr
@@ -1,10 +1,10 @@
-error: equality constraints are not yet supported in where clauses
+error: equality constraints are not yet supported in `where` clauses
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:46
    |
 LL | fn dent_object_2<COLOR>(c: dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not supported
    |
-   = note: for more information, see #20041
+   = note: for more information, see https://github.com/rust-lang/rust/issues/20041
 
 error[E0221]: ambiguous associated type `Color` in bounds of `C`
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:19:32
@@ -45,7 +45,7 @@ LL | fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
                    T: Box::Color = COLOR,
                    T: Vehicle::Color = COLOR
 
-error[E0191]: the value of the associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
+error[E0191]: the value of the associated types `Color` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:30
    |
 LL |     type Color;
@@ -80,7 +80,7 @@ help: use fully qualified syntax to disambiguate
 LL | fn paint<C:BoxCar>(c: C, d: <C as Vehicle>::Color) {
    |                             ^^^^^^^^^^^^^^^^^^^^^
 
-error[E0191]: the value of the associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
+error[E0191]: the value of the associated types `Color` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
    |
 LL |     type Color;
diff --git a/src/test/ui/associated-types/missing-associated-types.stderr b/src/test/ui/associated-types/missing-associated-types.stderr
index 7d5207fa321..f9951170acd 100644
--- a/src/test/ui/associated-types/missing-associated-types.stderr
+++ b/src/test/ui/associated-types/missing-associated-types.stderr
@@ -9,8 +9,8 @@ LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>;
    |                     first non-auto trait
    |                     trait alias used in trait object type (first use)
 
-error[E0191]: the value of the associated types `A` (from trait `Y`), `Output` (from trait `std::ops::Mul`), `Output` (from trait `std::ops::Add`), `Output` (from trait `std::ops::Sub`) must be specified
-  --> $DIR/missing-associated-types.rs:12:52
+error[E0191]: the value of the associated types `A` (from trait `Y`), `Output` (from trait `std::ops::Add`), `Output` (from trait `std::ops::Mul`), `Output` (from trait `std::ops::Sub`) must be specified
+  --> $DIR/missing-associated-types.rs:12:21
    |
 LL |     type A;
    |     ------- `A` defined here
@@ -38,8 +38,8 @@ LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>;
    |                     first non-auto trait
    |                     trait alias used in trait object type (first use)
 
-error[E0191]: the value of the associated types `Output` (from trait `std::ops::Mul`), `Output` (from trait `std::ops::Div`), `Output` (from trait `std::ops::Sub`), `A` (from trait `Z`), `B` (from trait `Z`), `Output` (from trait `std::ops::Div`), `Output` (from trait `std::ops::Add`) must be specified
-  --> $DIR/missing-associated-types.rs:15:43
+error[E0191]: the value of the associated types `A` (from trait `Z`), `B` (from trait `Z`), `Output` (from trait `std::ops::Add`), `Output` (from trait `std::ops::Div`), `Output` (from trait `std::ops::Div`), `Output` (from trait `std::ops::Mul`), `Output` (from trait `std::ops::Sub`) must be specified
+  --> $DIR/missing-associated-types.rs:15:21
    |
 LL |     type A;
    |     ------- `A` defined here
@@ -74,8 +74,8 @@ LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>;
    |                     first non-auto trait
    |                     trait alias used in trait object type (first use)
 
-error[E0191]: the value of the associated types `Output` (from trait `std::ops::Sub`), `A` (from trait `Y`), `Output` (from trait `std::ops::Add`) must be specified
-  --> $DIR/missing-associated-types.rs:18:32
+error[E0191]: the value of the associated types `A` (from trait `Y`), `Output` (from trait `std::ops::Add`), `Output` (from trait `std::ops::Sub`) must be specified
+  --> $DIR/missing-associated-types.rs:18:21
    |
 LL |     type A;
    |     ------- `A` defined here
@@ -102,8 +102,8 @@ LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
    |                     first non-auto trait
    |                     trait alias used in trait object type (first use)
 
-error[E0191]: the value of the associated types `Output` (from trait `std::ops::Sub`), `Output` (from trait `std::ops::Add`) must be specified
-  --> $DIR/missing-associated-types.rs:21:32
+error[E0191]: the value of the associated types `Output` (from trait `std::ops::Add`), `Output` (from trait `std::ops::Sub`) must be specified
+  --> $DIR/missing-associated-types.rs:21:21
    |
 LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
    |                     ^^^^^^^^   ^^^^^^^^ associated type `Output` must be specified
@@ -115,7 +115,7 @@ help: specify the associated types
 LL | type Bat<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Fine<Rhs>;
    |                     ^^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0191]: the value of the associated types `Output` (from trait `std::ops::Mul`), `Output` (from trait `std::ops::Div`) must be specified
+error[E0191]: the value of the associated types `Output` (from trait `std::ops::Div`), `Output` (from trait `std::ops::Mul`) must be specified
   --> $DIR/missing-associated-types.rs:24:21
    |
 LL | type Bal<Rhs> = dyn X<Rhs>;
diff --git a/src/test/ui/issues/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr
index bf80b24fa56..e5e50ddd155 100644
--- a/src/test/ui/issues/issue-22560.stderr
+++ b/src/test/ui/issues/issue-22560.stderr
@@ -35,8 +35,8 @@ LL | type Test = dyn Add + Sub;
    |                 first non-auto trait
    |                 trait alias used in trait object type (first use)
 
-error[E0191]: the value of the associated types `Output` (from trait `Sub`), `Output` (from trait `Add`) must be specified
-  --> $DIR/issue-22560.rs:9:23
+error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
+  --> $DIR/issue-22560.rs:9:17
    |
 LL |     type Output;
    |     ------------ `Output` defined here