about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-10-04 01:10:51 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-10-30 22:12:07 +0000
commit17a6ae2df3bc3344c87aacdaea1af84bb6e48582 (patch)
tree6823ba08dfd61f839a0eacc676e1dd8b398c1369 /tests/ui/error-codes
parent6d1fc53cf4f61b0dce5fc84cebae3b9fb8a45436 (diff)
downloadrust-17a6ae2df3bc3344c87aacdaea1af84bb6e48582.tar.gz
rust-17a6ae2df3bc3344c87aacdaea1af84bb6e48582.zip
Detect object safety errors when assoc type is missing
When an associated type with GATs isn't specified in a `dyn Trait`, emit
an object safety error instead of only complaining about the missing
associated type, as it will lead the user down a path of three different
errors before letting them know that what they were trying to do is
impossible to begin with.

Fix #103155.
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0191.stderr2
-rw-r--r--tests/ui/error-codes/E0220.stderr2
-rw-r--r--tests/ui/error-codes/E0719.stderr6
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/error-codes/E0191.stderr b/tests/ui/error-codes/E0191.stderr
index cf80c9c46ca..57eda4785a9 100644
--- a/tests/ui/error-codes/E0191.stderr
+++ b/tests/ui/error-codes/E0191.stderr
@@ -1,4 +1,4 @@
-error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+error[E0191]: the value of the associated type `Bar` in `Trait` must be specified
   --> $DIR/E0191.rs:5:16
    |
 LL |     type Bar;
diff --git a/tests/ui/error-codes/E0220.stderr b/tests/ui/error-codes/E0220.stderr
index e03eadacae4..0e0b5c7084c 100644
--- a/tests/ui/error-codes/E0220.stderr
+++ b/tests/ui/error-codes/E0220.stderr
@@ -4,7 +4,7 @@ error[E0220]: associated type `F` not found for `Trait`
 LL | type Foo = dyn Trait<F=i32>;
    |                      ^ help: `Trait` has the following associated type: `Bar`
 
-error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified
+error[E0191]: the value of the associated type `Bar` in `Trait` must be specified
   --> $DIR/E0220.rs:5:16
    |
 LL |     type Bar;
diff --git a/tests/ui/error-codes/E0719.stderr b/tests/ui/error-codes/E0719.stderr
index 685bd7175e3..00aea97139a 100644
--- a/tests/ui/error-codes/E0719.stderr
+++ b/tests/ui/error-codes/E0719.stderr
@@ -1,4 +1,4 @@
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+error[E0719]: the value of the associated type `Item` in trait `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 trait `Iterator`) is already specified
+error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
   --> $DIR/E0719.rs:1:33
    |
 LL | trait Foo: Iterator<Item = i32, Item = i32> {}
@@ -16,7 +16,7 @@ LL | trait Foo: Iterator<Item = i32, Item = i32> {}
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
   --> $DIR/E0719.rs:7:42
    |
 LL | fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {