about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-11-08 18:54:34 -0800
committerEsteban Küber <esteban@kuber.com.ar>2018-11-22 14:14:27 -0800
commit48fa974211990ec2dd2b8d8c6949d101fb51bb45 (patch)
tree2d3395ec5e84232d2d1832bf56d968ef1c0ab8d5 /src/test
parentb6f4b29c6df3fc78adbda9c915f01f8e354d9ca1 (diff)
downloadrust-48fa974211990ec2dd2b8d8c6949d101fb51bb45.tar.gz
rust-48fa974211990ec2dd2b8d8c6949d101fb51bb45.zip
Suggest correct syntax when writing type arg instead of assoc type
When confusing an associated type with a type argument, suggest the
appropriate syntax.

Given `Iterator<isize>`, suggest `Iterator<Item = isize>`.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs (renamed from src/test/ui/error-codes/E0107-b.rs)0
-rw-r--r--src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr (renamed from src/test/ui/error-codes/E0107-b.stderr)8
2 files changed, 6 insertions, 2 deletions
diff --git a/src/test/ui/error-codes/E0107-b.rs b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs
index 58e7718ba5b..58e7718ba5b 100644
--- a/src/test/ui/error-codes/E0107-b.rs
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.rs
diff --git a/src/test/ui/error-codes/E0107-b.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
index 1e8c683aff6..053f7010421 100644
--- a/src/test/ui/error-codes/E0107-b.stderr
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
@@ -1,5 +1,5 @@
 error[E0107]: wrong number of type arguments: expected 2, found 4
-  --> $DIR/E0107-b.rs:6:42
+  --> $DIR/use-type-argument-instead-of-assoc-type.rs:6:42
    |
 LL |  pub struct Foo { i: Box<T<usize, usize, usize, usize, B=usize>> }
    |                                          ^^^^^  ^^^^^ unexpected type argument
@@ -7,7 +7,7 @@ LL |  pub struct Foo { i: Box<T<usize, usize, usize, usize, B=usize>> }
    |                                          unexpected type argument
 
 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
+  --> $DIR/use-type-argument-instead-of-assoc-type.rs:6:26
    |
 LL |     type A;
    |     ------- `A` defined here
@@ -20,6 +20,10 @@ 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
+   |
+LL |  pub struct Foo { i: Box<T<usize, usize, A = usize, C = usize, B=usize>> }
+   |                                          ^^^^^^^^^  ^^^^^^^^^
 
 error: aborting due to 2 previous errors