about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-11-08 18:14:41 -0800
committerEsteban Küber <esteban@kuber.com.ar>2018-11-22 14:14:27 -0800
commitb6f4b29c6df3fc78adbda9c915f01f8e354d9ca1 (patch)
tree96d3a90a5dd8f6e3d0358e77da7532a126f4cefc /src
parent286f7ae1dde03478fc0f36b7d1f3dc97cb47b730 (diff)
downloadrust-b6f4b29c6df3fc78adbda9c915f01f8e354d9ca1.tar.gz
rust-b6f4b29c6df3fc78adbda9c915f01f8e354d9ca1.zip
Point at the associated type's def span
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/astconv.rs4
-rw-r--r--src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr3
-rw-r--r--src/test/ui/associated-types/associated-types-incomplete-object.stderr11
-rw-r--r--src/test/ui/error-codes/E0107-b.stderr6
-rw-r--r--src/test/ui/error-codes/E0191.stderr3
-rw-r--r--src/test/ui/error-codes/E0220.stderr3
-rw-r--r--src/test/ui/issues/issue-19482.stderr3
-rw-r--r--src/test/ui/issues/issue-21950.stderr5
-rw-r--r--src/test/ui/issues/issue-22434.stderr3
-rw-r--r--src/test/ui/issues/issue-22560.stderr5
-rw-r--r--src/test/ui/issues/issue-23024.stderr5
-rw-r--r--src/test/ui/issues/issue-28344.stderr10
-rw-r--r--src/test/ui/traits/trait-alias-object.stderr5
13 files changed, 66 insertions, 0 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 906b800ee44..173f7ababe3 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1053,6 +1053,10 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
                     span,
                     format!("missing associated type `{}` value", assoc_item.ident),
                 );
+                err.span_label(
+                    tcx.def_span(item_def_id),
+                    format!("`{}` defined here", assoc_item.ident),
+                );
             }
             err.emit();
         }
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 7a10b6d021f..726078f44a7 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
@@ -25,6 +25,9 @@ LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
 error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:33:26
    |
+LL |     type Color;
+   |     ----------- `Color` defined here
+...
 LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
    |                          ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
 
diff --git a/src/test/ui/associated-types/associated-types-incomplete-object.stderr b/src/test/ui/associated-types/associated-types-incomplete-object.stderr
index 5a3c243efd0..933f059ebf4 100644
--- a/src/test/ui/associated-types/associated-types-incomplete-object.stderr
+++ b/src/test/ui/associated-types/associated-types-incomplete-object.stderr
@@ -1,18 +1,29 @@
 error[E0191]: the value of the associated type `B` (from the trait `Foo`) must be specified
   --> $DIR/associated-types-incomplete-object.rs:33:26
    |
+LL |     type B;
+   |     ------- `B` defined here
+...
 LL |     let b = &42isize as &Foo<A=usize>;
    |                          ^^^^^^^^^^^^ missing associated type `B` value
 
 error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified
   --> $DIR/associated-types-incomplete-object.rs:36:26
    |
+LL |     type A;
+   |     ------- `A` defined here
+...
 LL |     let c = &42isize as &Foo<B=char>;
    |                          ^^^^^^^^^^^ missing associated type `A` value
 
 error[E0191]: the value of the associated types `A` (from the trait `Foo`), `B` (from the trait `Foo`) must be specified
   --> $DIR/associated-types-incomplete-object.rs:39:26
    |
+LL |     type A;
+   |     ------- `A` defined here
+LL |     type B;
+   |     ------- `B` defined here
+...
 LL |     let d = &42isize as &Foo;
    |                          ^^^
    |                          |
diff --git a/src/test/ui/error-codes/E0107-b.stderr b/src/test/ui/error-codes/E0107-b.stderr
index f779ca1e0b1..1e8c683aff6 100644
--- a/src/test/ui/error-codes/E0107-b.stderr
+++ b/src/test/ui/error-codes/E0107-b.stderr
@@ -9,6 +9,12 @@ LL |  pub struct Foo { i: Box<T<usize, usize, usize, usize, B=usize>> }
 error[E0191]: the value of the associated types `A` (from the trait `T`), `C` (from the trait `T`) must be specified
   --> $DIR/E0107-b.rs:6:26
    |
+LL |     type A;
+   |     ------- `A` defined here
+LL |     type B;
+LL |     type C;
+   |     ------- `C` defined here
+LL | }
 LL |  pub struct Foo { i: Box<T<usize, usize, usize, usize, B=usize>> }
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                          |
diff --git a/src/test/ui/error-codes/E0191.stderr b/src/test/ui/error-codes/E0191.stderr
index 08b0a845814..a1f7c935c4a 100644
--- a/src/test/ui/error-codes/E0191.stderr
+++ b/src/test/ui/error-codes/E0191.stderr
@@ -1,6 +1,9 @@
 error[E0191]: the value of the associated type `Bar` (from the trait `Trait`) must be specified
   --> $DIR/E0191.rs:15:12
    |
+LL |     type Bar;
+   |     --------- `Bar` defined here
+...
 LL | type Foo = Trait; //~ ERROR E0191
    |            ^^^^^ missing associated type `Bar` value
 
diff --git a/src/test/ui/error-codes/E0220.stderr b/src/test/ui/error-codes/E0220.stderr
index c8a587f2b53..7ddd912d4f2 100644
--- a/src/test/ui/error-codes/E0220.stderr
+++ b/src/test/ui/error-codes/E0220.stderr
@@ -7,6 +7,9 @@ LL | type Foo = Trait<F=i32>; //~ ERROR E0220
 error[E0191]: the value of the associated type `Bar` (from the trait `Trait`) must be specified
   --> $DIR/E0220.rs:15:12
    |
+LL |     type Bar;
+   |     --------- `Bar` defined here
+...
 LL | type Foo = Trait<F=i32>; //~ ERROR E0220
    |            ^^^^^^^^^^^^ missing associated type `Bar` value
 
diff --git a/src/test/ui/issues/issue-19482.stderr b/src/test/ui/issues/issue-19482.stderr
index 5e2d427ab72..7e71b0bd232 100644
--- a/src/test/ui/issues/issue-19482.stderr
+++ b/src/test/ui/issues/issue-19482.stderr
@@ -1,6 +1,9 @@
 error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified
   --> $DIR/issue-19482.rs:20:12
    |
+LL |     type A;
+   |     ------- `A` defined here
+...
 LL | fn bar(x: &Foo) {}
    |            ^^^ missing associated type `A` value
 
diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr
index a2f74a29aab..3359225ab6d 100644
--- a/src/test/ui/issues/issue-21950.stderr
+++ b/src/test/ui/issues/issue-21950.stderr
@@ -11,6 +11,11 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
    |
 LL |             &Add;
    |              ^^^ missing associated type `Output` value
+   | 
+  ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
+   |
+LL |     type Output;
+   |     ------------ `Output` defined here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-22434.stderr b/src/test/ui/issues/issue-22434.stderr
index 914da801ad4..d951d57444d 100644
--- a/src/test/ui/issues/issue-22434.stderr
+++ b/src/test/ui/issues/issue-22434.stderr
@@ -1,6 +1,9 @@
 error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified
   --> $DIR/issue-22434.rs:15:19
    |
+LL |     type A;
+   |     ------- `A` defined here
+...
 LL | type I<'a> = &'a (Foo + 'a);
    |                   ^^^^^^^^ missing associated type `A` value
 
diff --git a/src/test/ui/issues/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr
index b5524036fae..8f736aa0345 100644
--- a/src/test/ui/issues/issue-22560.stderr
+++ b/src/test/ui/issues/issue-22560.stderr
@@ -29,6 +29,11 @@ LL | |             //~^ ERROR E0393
 LL | |             //~| ERROR E0191
 LL | |             Sub;
    | |_______________^ missing associated type `Output` value
+   | 
+  ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
+   |
+LL |       type Output;
+   |       ------------ `Output` defined here
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr
index 129d0945303..8a493468dbf 100644
--- a/src/test/ui/issues/issue-23024.stderr
+++ b/src/test/ui/issues/issue-23024.stderr
@@ -17,6 +17,11 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
    |
 LL |     println!("{:?}",(vfnfer[0] as Fn)(3));
    |                                   ^^ missing associated type `Output` value
+   | 
+  ::: $SRC_DIR/libcore/ops/function.rs:LL:COL
+   |
+LL |     type Output;
+   |     ------------ `Output` defined here
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr
index 7ef2e906422..67588ba46f2 100644
--- a/src/test/ui/issues/issue-28344.stderr
+++ b/src/test/ui/issues/issue-28344.stderr
@@ -3,6 +3,11 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
    |
 LL |     let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
    |                 ^^^^^^^^^^^^^ missing associated type `Output` value
+   | 
+  ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
+   |
+LL |     type Output;
+   |     ------------ `Output` defined here
 
 error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
   --> $DIR/issue-28344.rs:14:17
@@ -17,6 +22,11 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
    |
 LL |     let g = BitXor::bitor;
    |             ^^^^^^^^^^^^^ missing associated type `Output` value
+   | 
+  ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
+   |
+LL |     type Output;
+   |     ------------ `Output` defined here
 
 error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
   --> $DIR/issue-28344.rs:18:13
diff --git a/src/test/ui/traits/trait-alias-object.stderr b/src/test/ui/traits/trait-alias-object.stderr
index 6b7b322a53d..0ae9b0b8864 100644
--- a/src/test/ui/traits/trait-alias-object.stderr
+++ b/src/test/ui/traits/trait-alias-object.stderr
@@ -11,6 +11,11 @@ error[E0191]: the value of the associated type `Item` (from the trait `std::iter
    |
 LL |     let _: &dyn IteratorAlias = &vec![123].into_iter();
    |             ^^^^^^^^^^^^^^^^^ missing associated type `Item` value
+   | 
+  ::: $SRC_DIR/libcore/iter/iterator.rs:LL:COL
+   |
+LL |     type Item;
+   |     ---------- `Item` defined here
 
 error: aborting due to 2 previous errors