about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_typeck/astconv.rs9
-rw-r--r--src/test/compile-fail/issue-23595-1.rs4
-rw-r--r--src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr2
-rw-r--r--src/test/ui/associated-types/associated-types-incomplete-object.stderr8
-rw-r--r--src/test/ui/error-codes/E0191.stderr2
-rw-r--r--src/test/ui/error-codes/E0220.stderr2
-rw-r--r--src/test/ui/issues/issue-19482.stderr2
-rw-r--r--src/test/ui/issues/issue-21950.stderr2
-rw-r--r--src/test/ui/issues/issue-22434.stderr2
-rw-r--r--src/test/ui/issues/issue-22560.stderr2
-rw-r--r--src/test/ui/issues/issue-23024.stderr2
-rw-r--r--src/test/ui/issues/issue-28344.stderr4
-rw-r--r--src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr6
-rw-r--r--src/test/ui/traits/trait-alias-object.stderr2
14 files changed, 26 insertions, 23 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index f1192cf98ae..b583c0554e8 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1066,7 +1066,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
                 let assoc_item = tcx.associated_item(*item_def_id);
                 err.span_label(
                     span,
-                    format!("missing associated type `{}` value", assoc_item.ident),
+                    format!("associated type `{}` must be specified", assoc_item.ident),
                 );
                 err.span_label(
                     tcx.def_span(*item_def_id),
@@ -1084,8 +1084,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
                 }
             }
             if !suggestions.is_empty() {
+                let msg = if suggestions.len() == 1 {
+                    "if you meant to specify the associated type, write"
+                } else {
+                    "if you meant to specify the associated types, write"
+                };
                 err.multipart_suggestion_with_applicability(
-                    "if you meant to assign the missing associated type, use the name",
+                    msg,
                     suggestions,
                     Applicability::MaybeIncorrect,
                 );
diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/compile-fail/issue-23595-1.rs
index a3422d859c6..1e615c4c0db 100644
--- a/src/test/compile-fail/issue-23595-1.rs
+++ b/src/test/compile-fail/issue-23595-1.rs
@@ -16,9 +16,7 @@ trait Hierarchy {
     type Value;
     type ChildKey;
     type Children = Index<Self::ChildKey, Output=Hierarchy>;
-    //~^ ERROR: the value of the associated type `ChildKey`
-    //~^^ ERROR: the value of the associated type `Children`
-    //~^^^ ERROR: the value of the associated type `Value`
+    //~^ ERROR: the value of the associated types `Value` (from the trait `Hierarchy`), `ChildKey`
 
     fn data(&self) -> Option<(Self::Value, Self::Children)>;
 }
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 726078f44a7..b4285c0de29 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
@@ -29,7 +29,7 @@ LL |     type Color;
    |     ----------- `Color` defined here
 ...
 LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
-   |                          ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
+   |                          ^^^^^^^^^^^^^^^^^^^ associated type `Color` must be specified
 
 error[E0221]: ambiguous associated type `Color` in bounds of `C`
   --> $DIR/associated-type-projection-from-multiple-supertraits.rs:38:29
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 933f059ebf4..eb8e6f998a5 100644
--- a/src/test/ui/associated-types/associated-types-incomplete-object.stderr
+++ b/src/test/ui/associated-types/associated-types-incomplete-object.stderr
@@ -5,7 +5,7 @@ LL |     type B;
    |     ------- `B` defined here
 ...
 LL |     let b = &42isize as &Foo<A=usize>;
-   |                          ^^^^^^^^^^^^ missing associated type `B` value
+   |                          ^^^^^^^^^^^^ associated type `B` must be specified
 
 error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified
   --> $DIR/associated-types-incomplete-object.rs:36:26
@@ -14,7 +14,7 @@ LL |     type A;
    |     ------- `A` defined here
 ...
 LL |     let c = &42isize as &Foo<B=char>;
-   |                          ^^^^^^^^^^^ missing associated type `A` value
+   |                          ^^^^^^^^^^^ associated type `A` must be specified
 
 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
@@ -27,8 +27,8 @@ LL |     type B;
 LL |     let d = &42isize as &Foo;
    |                          ^^^
    |                          |
-   |                          missing associated type `A` value
-   |                          missing associated type `B` value
+   |                          associated type `A` must be specified
+   |                          associated type `B` must be specified
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/error-codes/E0191.stderr b/src/test/ui/error-codes/E0191.stderr
index a1f7c935c4a..f07529e7e9e 100644
--- a/src/test/ui/error-codes/E0191.stderr
+++ b/src/test/ui/error-codes/E0191.stderr
@@ -5,7 +5,7 @@ LL |     type Bar;
    |     --------- `Bar` defined here
 ...
 LL | type Foo = Trait; //~ ERROR E0191
-   |            ^^^^^ missing associated type `Bar` value
+   |            ^^^^^ associated type `Bar` must be specified
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0220.stderr b/src/test/ui/error-codes/E0220.stderr
index 7ddd912d4f2..d26e61fba8c 100644
--- a/src/test/ui/error-codes/E0220.stderr
+++ b/src/test/ui/error-codes/E0220.stderr
@@ -11,7 +11,7 @@ LL |     type Bar;
    |     --------- `Bar` defined here
 ...
 LL | type Foo = Trait<F=i32>; //~ ERROR E0220
-   |            ^^^^^^^^^^^^ missing associated type `Bar` value
+   |            ^^^^^^^^^^^^ associated type `Bar` must be specified
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-19482.stderr b/src/test/ui/issues/issue-19482.stderr
index 7e71b0bd232..d125438b851 100644
--- a/src/test/ui/issues/issue-19482.stderr
+++ b/src/test/ui/issues/issue-19482.stderr
@@ -5,7 +5,7 @@ LL |     type A;
    |     ------- `A` defined here
 ...
 LL | fn bar(x: &Foo) {}
-   |            ^^^ missing associated type `A` value
+   |            ^^^ associated type `A` must be specified
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr
index 3359225ab6d..2cc064dad1b 100644
--- a/src/test/ui/issues/issue-21950.stderr
+++ b/src/test/ui/issues/issue-21950.stderr
@@ -10,7 +10,7 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
   --> $DIR/issue-21950.rs:17:14
    |
 LL |             &Add;
-   |              ^^^ missing associated type `Output` value
+   |              ^^^ associated type `Output` must be specified
    | 
   ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
    |
diff --git a/src/test/ui/issues/issue-22434.stderr b/src/test/ui/issues/issue-22434.stderr
index d951d57444d..3ba77346a1f 100644
--- a/src/test/ui/issues/issue-22434.stderr
+++ b/src/test/ui/issues/issue-22434.stderr
@@ -5,7 +5,7 @@ LL |     type A;
    |     ------- `A` defined here
 ...
 LL | type I<'a> = &'a (Foo + 'a);
-   |                   ^^^^^^^^ missing associated type `A` value
+   |                   ^^^^^^^^ associated type `A` must be specified
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr
index 8f736aa0345..bfce870196a 100644
--- a/src/test/ui/issues/issue-22560.stderr
+++ b/src/test/ui/issues/issue-22560.stderr
@@ -28,7 +28,7 @@ LL |   type Test = Add +
 LL | |             //~^ ERROR E0393
 LL | |             //~| ERROR E0191
 LL | |             Sub;
-   | |_______________^ missing associated type `Output` value
+   | |_______________^ associated type `Output` must be specified
    | 
   ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
    |
diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr
index 8a493468dbf..198469ca723 100644
--- a/src/test/ui/issues/issue-23024.stderr
+++ b/src/test/ui/issues/issue-23024.stderr
@@ -16,7 +16,7 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
   --> $DIR/issue-23024.rs:19:35
    |
 LL |     println!("{:?}",(vfnfer[0] as Fn)(3));
-   |                                   ^^ missing associated type `Output` value
+   |                                   ^^ associated type `Output` must be specified
    | 
   ::: $SRC_DIR/libcore/ops/function.rs:LL:COL
    |
diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr
index 67588ba46f2..824ba4b49cb 100644
--- a/src/test/ui/issues/issue-28344.stderr
+++ b/src/test/ui/issues/issue-28344.stderr
@@ -2,7 +2,7 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
   --> $DIR/issue-28344.rs:14:17
    |
 LL |     let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
-   |                 ^^^^^^^^^^^^^ missing associated type `Output` value
+   |                 ^^^^^^^^^^^^^ associated type `Output` must be specified
    | 
   ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
    |
@@ -21,7 +21,7 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
   --> $DIR/issue-28344.rs:18:13
    |
 LL |     let g = BitXor::bitor;
-   |             ^^^^^^^^^^^^^ missing associated type `Output` value
+   |             ^^^^^^^^^^^^^ associated type `Output` must be specified
    | 
   ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
    |
diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
index 053f7010421..b62b5d3b04c 100644
--- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
@@ -18,9 +18,9 @@ LL | }
 LL |  pub struct Foo { i: Box<T<usize, usize, usize, usize, B=usize>> }
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                          |
-   |                          missing associated type `A` value
-   |                          missing associated type `C` value
-help: if you meant to assign the missing associated type, use the name
+   |                          associated type `A` must be specified
+   |                          associated type `C` must be specified
+help: if you meant to specify the associated types, write
    |
 LL |  pub struct Foo { i: Box<T<usize, usize, A = usize, C = usize, B=usize>> }
    |                                          ^^^^^^^^^  ^^^^^^^^^
diff --git a/src/test/ui/traits/trait-alias-object.stderr b/src/test/ui/traits/trait-alias-object.stderr
index 0ae9b0b8864..c316c4a6beb 100644
--- a/src/test/ui/traits/trait-alias-object.stderr
+++ b/src/test/ui/traits/trait-alias-object.stderr
@@ -10,7 +10,7 @@ error[E0191]: the value of the associated type `Item` (from the trait `std::iter
   --> $DIR/trait-alias-object.rs:18:13
    |
 LL |     let _: &dyn IteratorAlias = &vec![123].into_iter();
-   |             ^^^^^^^^^^^^^^^^^ missing associated type `Item` value
+   |             ^^^^^^^^^^^^^^^^^ associated type `Item` must be specified
    | 
   ::: $SRC_DIR/libcore/iter/iterator.rs:LL:COL
    |