about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-10-29 16:49:01 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-12-10 12:02:18 -0800
commit12af2561e9936add8fab4b96ff206b00a5877efe (patch)
treeb5b5410af50110a0231f489451b3611ab6adf644 /src/test/ui/span
parent7dbfb0a8ca4ab74ee3111e57a024f9e6257ce37c (diff)
downloadrust-12af2561e9936add8fab4b96ff206b00a5877efe.tar.gz
rust-12af2561e9936add8fab4b96ff206b00a5877efe.zip
Point at method call when type annotations are needed
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.rs4
-rw-r--r--src/test/ui/span/issue-42234-unknown-receiver-type.stderr7
-rw-r--r--src/test/ui/span/type-annotations-needed-expr.stderr5
3 files changed, 9 insertions, 7 deletions
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.rs b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
index 58138e21bc0..d3292bbecba 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.rs
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
@@ -9,8 +9,8 @@ fn shines_a_beacon_through_the_darkness() {
 }
 
 fn courier_to_des_moines_and_points_west(data: &[u32]) -> String {
-    data.iter() //~ ERROR type annotations needed
-        .sum::<_>()
+    data.iter()
+        .sum::<_>() //~ ERROR type annotations needed
         .to_string()
 }
 
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
index 30c9adb1dce..093a6f6f3eb 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
@@ -9,11 +9,10 @@ LL |     x.unwrap().method_that_could_exist_on_some_type();
    = note: type must be known at this point
 
 error[E0282]: type annotations needed
-  --> $DIR/issue-42234-unknown-receiver-type.rs:12:5
+  --> $DIR/issue-42234-unknown-receiver-type.rs:13:10
    |
-LL | /     data.iter()
-LL | |         .sum::<_>()
-   | |___________________^ cannot infer type
+LL |         .sum::<_>()
+   |          ^^^ cannot infer type
    |
    = note: type must be known at this point
 
diff --git a/src/test/ui/span/type-annotations-needed-expr.stderr b/src/test/ui/span/type-annotations-needed-expr.stderr
index e32a542bb7a..1efb2720e0c 100644
--- a/src/test/ui/span/type-annotations-needed-expr.stderr
+++ b/src/test/ui/span/type-annotations-needed-expr.stderr
@@ -2,7 +2,10 @@ error[E0282]: type annotations needed
   --> $DIR/type-annotations-needed-expr.rs:2:39
    |
 LL |     let _ = (vec![1,2,3]).into_iter().sum() as f64;
-   |                                       ^^^ cannot infer type for `S`
+   |                                       ^^^
+   |                                       |
+   |                                       cannot infer type for `S`
+   |                                       help: consider specifying the type argument in the method call: `sum::<_>`
    |
    = note: type must be known at this point