diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-08 13:25:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-08 13:25:59 -0700 |
| commit | 7db3f8696625f9abeb15fd7726194199ba4a152b (patch) | |
| tree | 9a06e894b316c561d3e40e20c6551125b868c40d /src | |
| parent | 0a3766a41a857c262d03a6a7f5d9150171299f1b (diff) | |
| parent | 6eb0218075aa0bfcfd96c6872b30b64dbde1a8d6 (diff) | |
| download | rust-7db3f8696625f9abeb15fd7726194199ba4a152b.tar.gz rust-7db3f8696625f9abeb15fd7726194199ba4a152b.zip | |
Rollup merge of #35507 - hank-der-hafenarbeiter:master, r=jonathandturner
Updated Error mesage to new format for E0221 Part of #35386 r? @jonathandturner
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 10 | ||||
| -rw-r--r-- | src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index efefe848c69..07595c5dbe1 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1287,10 +1287,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { } if bounds.len() > 1 { - let mut err = struct_span_err!(self.tcx().sess, span, E0221, - "ambiguous associated type `{}` in bounds of `{}`", - assoc_name, - ty_param_name); + let mut err = struct_span_err!( + self.tcx().sess, span, E0221, + "ambiguous associated type `{}` in bounds of `{}`", + assoc_name, + ty_param_name); + err.span_label(span, &format!("ambiguous associated type `{}`", assoc_name)); for bound in &bounds { span_note!(&mut err, span, diff --git a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs index 007f1d3a294..a2a11c62bb8 100644 --- a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs +++ b/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs @@ -28,6 +28,7 @@ pub trait BoxCar : Box + Vehicle { fn dent<C:BoxCar>(c: C, color: C::Color) { //~^ ERROR ambiguous associated type `Color` in bounds of `C` + //~| NOTE ambiguous associated type `Color` //~| NOTE could derive from `Vehicle` //~| NOTE could derive from `Box` } @@ -35,6 +36,7 @@ fn dent<C:BoxCar>(c: C, color: C::Color) { fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) { //~^ ERROR ambiguous associated type //~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified + //~| NOTE ambiguous associated type `Color` //~| NOTE could derive from `Vehicle` //~| NOTE could derive from `Box` //~| NOTE missing associated type `Color` value @@ -42,6 +44,7 @@ fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) { fn paint<C:BoxCar>(c: C, d: C::Color) { //~^ ERROR ambiguous associated type `Color` in bounds of `C` + //~| NOTE ambiguous associated type `Color` //~| NOTE could derive from `Vehicle` //~| NOTE could derive from `Box` } |
