Fix rebase and sort assoc type list for deterministic output

This commit is contained in:
Esteban Küber 2019-12-24 14:10:55 -08:00
parent 93fb219579
commit 621d7e959b
6 changed files with 21 additions and 19 deletions

View File

@ -1686,6 +1686,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}, },
_ => {} _ => {}
} }
names.sort();
trait_bound_spans.sort();
let mut err = struct_span_err!( let mut err = struct_span_err!(
tcx.sess, tcx.sess,
trait_bound_spans, trait_bound_spans,

View File

@ -6,7 +6,7 @@ trait Hierarchy {
type Value; type Value;
type ChildKey; type ChildKey;
type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>; 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)>; fn data(&self) -> Option<(Self::Value, Self::Children)>;
} }

View File

@ -22,7 +22,7 @@ fn dent<C:BoxCar>(c: C, color: C::Color) {
fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) { fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
//~^ ERROR ambiguous associated type //~^ 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) { 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 { 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 the value of the associated types
//~| ERROR equality constraints are not yet supported in where clauses //~| ERROR equality constraints are not yet supported in `where` clauses
} }
fn dent_object_3<X, COLOR>(c: X) fn dent_object_3<X, COLOR>(c: X)

View File

@ -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 --> $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 { LL | fn dent_object_2<COLOR>(c: dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not supported | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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` error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:19:32 --> $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: Box::Color = COLOR,
T: Vehicle::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 --> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:30
| |
LL | type Color; 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) { 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 --> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
| |
LL | type Color; LL | type Color;

View File

@ -9,8 +9,8 @@ LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>;
| first non-auto trait | first non-auto trait
| trait alias used in trait object type (first use) | 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 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:52 --> $DIR/missing-associated-types.rs:12:21
| |
LL | type A; LL | type A;
| ------- `A` defined here | ------- `A` defined here
@ -38,8 +38,8 @@ LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>;
| first non-auto trait | first non-auto trait
| trait alias used in trait object type (first use) | 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 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:43 --> $DIR/missing-associated-types.rs:15:21
| |
LL | type A; LL | type A;
| ------- `A` defined here | ------- `A` defined here
@ -74,8 +74,8 @@ LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>;
| first non-auto trait | first non-auto trait
| trait alias used in trait object type (first use) | 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 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:32 --> $DIR/missing-associated-types.rs:18:21
| |
LL | type A; LL | type A;
| ------- `A` defined here | ------- `A` defined here
@ -102,8 +102,8 @@ LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
| first non-auto trait | first non-auto trait
| trait alias used in trait object type (first use) | 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 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:32 --> $DIR/missing-associated-types.rs:21:21
| |
LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>; LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
| ^^^^^^^^ ^^^^^^^^ associated type `Output` must be specified | ^^^^^^^^ ^^^^^^^^ 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>; 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 --> $DIR/missing-associated-types.rs:24:21
| |
LL | type Bal<Rhs> = dyn X<Rhs>; LL | type Bal<Rhs> = dyn X<Rhs>;

View File

@ -35,8 +35,8 @@ LL | type Test = dyn Add + Sub;
| first non-auto trait | first non-auto trait
| trait alias used in trait object type (first use) | 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 error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
--> $DIR/issue-22560.rs:9:23 --> $DIR/issue-22560.rs:9:17
| |
LL | type Output; LL | type Output;
| ------------ `Output` defined here | ------------ `Output` defined here