From 547abe0c52fedc11cd4d1276f7ad51ce29a411e6 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Thu, 12 Dec 2019 14:48:46 -0800 Subject: Tweak errors for missing associated types and type parameters --- src/test/ui/error-codes/E0191.stderr | 6 +++--- src/test/ui/error-codes/E0220.stderr | 6 +++--- src/test/ui/error-codes/E0221.stderr | 20 ++++++++++++++------ src/test/ui/error-codes/E0393.stderr | 5 ++++- src/test/ui/error-codes/E0719.stderr | 4 ++-- 5 files changed, 26 insertions(+), 15 deletions(-) (limited to 'src/test/ui/error-codes') 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` 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; | ^^^^^ 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; - | ^^^^^^^^^^^^^^^^ associated type `Bar` must be specified + | ^^^^^^^^^^^^ help: specify the associated type: `Trait` 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 _: ::A; + | ^^^^^^^^^^^^^^^^ +help: use fully qualified syntax to disambiguate + | +LL | let _: ::A; + | ^^^^^^^^^^^^^^^^ error[E0221]: ambiguous associated type `Err` in bounds of `Self` --> $DIR/E0221.rs:21:16 @@ -16,14 +25,13 @@ error[E0221]: ambiguous associated type `Err` in bounds of `Self` 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: `::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 {} + | ------------------ 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` | = 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 {} @@ -6,7 +6,7 @@ LL | trait Foo: Iterator {} | | | `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> { -- cgit 1.4.1-3-g733a5