about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-12-12 14:48:46 -0800
committerEsteban Küber <esteban@kuber.com.ar>2019-12-24 22:02:43 -0800
commit547abe0c52fedc11cd4d1276f7ad51ce29a411e6 (patch)
tree0fda270872a6ee2e75af2810e28798ae999b4a00 /src/test/ui/error-codes
parentc5a2a9a99c3973f77d7c86acb8ff7039c3d9c703 (diff)
downloadrust-547abe0c52fedc11cd4d1276f7ad51ce29a411e6.tar.gz
rust-547abe0c52fedc11cd4d1276f7ad51ce29a411e6.zip
Tweak errors for missing associated types and type parameters
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0191.stderr6
-rw-r--r--src/test/ui/error-codes/E0220.stderr6
-rw-r--r--src/test/ui/error-codes/E0221.stderr20
-rw-r--r--src/test/ui/error-codes/E0393.stderr5
-rw-r--r--src/test/ui/error-codes/E0719.stderr4
5 files changed, 26 insertions, 15 deletions
diff --git a/src/test/ui/error-codes/E0191.stderr b/src/test/ui/error-codes/E0191.stderr
index 92fa85bca0e..d69a14916e1 100644
--- a/src/test/ui/error-codes/E0191.stderr
+++ b/src/test/ui/error-codes/E0191.stderr
@@ -1,11 +1,11 @@
-error[E0191]: the value of the associated type `Bar` (from the trait `Trait`) must be specified
-  --> $DIR/E0191.rs:5:12
+error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+  --> $DIR/E0191.rs:5:16
    |
 LL |     type Bar;
    |     --------- `Bar` defined here
 ...
 LL | type Foo = dyn Trait;
-   |            ^^^^^^^^^ associated type `Bar` must be specified
+   |                ^^^^^ help: specify the associated type: `Trait<Bar = Type>`
 
 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 5da302748cd..58a92fe9832 100644
--- a/src/test/ui/error-codes/E0220.stderr
+++ b/src/test/ui/error-codes/E0220.stderr
@@ -4,14 +4,14 @@ error[E0220]: associated type `F` not found for `Trait`
 LL | type Foo = dyn Trait<F=i32>;
    |                      ^^^^^ associated type `F` not found
 
-error[E0191]: the value of the associated type `Bar` (from the trait `Trait`) must be specified
-  --> $DIR/E0220.rs:5:12
+error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+  --> $DIR/E0220.rs:5:16
    |
 LL |     type Bar;
    |     --------- `Bar` defined here
 ...
 LL | type Foo = dyn Trait<F=i32>;
-   |            ^^^^^^^^^^^^^^^^ associated type `Bar` must be specified
+   |                ^^^^^^^^^^^^ help: specify the associated type: `Trait<F=i32, Bar = Type>`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/error-codes/E0221.stderr b/src/test/ui/error-codes/E0221.stderr
index 043f0c68bbc..0b4819143ce 100644
--- a/src/test/ui/error-codes/E0221.stderr
+++ b/src/test/ui/error-codes/E0221.stderr
@@ -9,6 +9,15 @@ LL |     type A: T2;
 LL |     fn do_something() {
 LL |         let _: Self::A;
    |                ^^^^^^^ ambiguous associated type `A`
+   |
+help: use fully qualified syntax to disambiguate
+   |
+LL |         let _: <Self as Foo>::A;
+   |                ^^^^^^^^^^^^^^^^
+help: use fully qualified syntax to disambiguate
+   |
+LL |         let _: <Self as Bar>::A;
+   |                ^^^^^^^^^^^^^^^^
 
 error[E0221]: ambiguous associated type `Err` in bounds of `Self`
   --> $DIR/E0221.rs:21:16
@@ -17,13 +26,12 @@ LL |     type Err: T3;
    |     ------------- ambiguous `Err` from `My`
 LL |     fn test() {
 LL |         let _: Self::Err;
-   |                ^^^^^^^^^ ambiguous associated type `Err`
-   |
-note: associated type `Self` could derive from `std::str::FromStr`
-  --> $DIR/E0221.rs:21:16
-   |
-LL |         let _: Self::Err;
    |                ^^^^^^^^^
+   |                |
+   |                ambiguous associated type `Err`
+   |                help: use fully qualified syntax to disambiguate: `<Self as My>::Err`
+   |
+   = note: associated type `Self` could derive from `std::str::FromStr`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/error-codes/E0393.stderr b/src/test/ui/error-codes/E0393.stderr
index 543e3213633..7771bacc9ed 100644
--- a/src/test/ui/error-codes/E0393.stderr
+++ b/src/test/ui/error-codes/E0393.stderr
@@ -1,8 +1,11 @@
 error[E0393]: the type parameter `T` must be explicitly specified
   --> $DIR/E0393.rs:3:47
    |
+LL | trait A<T=Self> {}
+   | ------------------ type parameter `T` must be specified for this
+LL | 
 LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {}
-   |                                               ^ missing reference to `T`
+   |                                               ^ help: set the type parameter to the desired type: `A<T>`
    |
    = note: because of the default `Self` reference, type parameters must be specified on object types
 
diff --git a/src/test/ui/error-codes/E0719.stderr b/src/test/ui/error-codes/E0719.stderr
index c5b9a71c659..a046fbfc3d0 100644
--- a/src/test/ui/error-codes/E0719.stderr
+++ b/src/test/ui/error-codes/E0719.stderr
@@ -1,4 +1,4 @@
-error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
+error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
   --> $DIR/E0719.rs:1:33
    |
 LL | trait Foo: Iterator<Item = i32, Item = i32> {}
@@ -6,7 +6,7 @@ LL | trait Foo: Iterator<Item = i32, Item = i32> {}
    |                     |
    |                     `Item` bound here first
 
-error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
+error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
   --> $DIR/E0719.rs:6:42
    |
 LL | fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {