From 4aab27bed67973c9db244cf4ddcd06e82b3bab0a Mon Sep 17 00:00:00 2001 From: sheroze1123 Date: Sat, 15 Nov 2014 14:05:11 -0500 Subject: [PATCH 1/2] Fix for issue #17574 --- src/librustc/middle/typeck/check/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index cac702d6ac0c3..141dd22f7e35f 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2534,7 +2534,7 @@ fn lookup_method_for_for_loop(fcx: &FnCtxt, let ty_string = fcx.infcx().ty_to_string(true_expr_type); fcx.tcx().sess.span_err(iterator_expr.span, format!("`for` loop expression has type `{}` which does \ - not implement the `Iterator` trait", + not implement the `Iterator` trait: maybe try .iter()", ty_string).as_slice()); } ty::mk_err() From f3a33ab4e8ced830250fbc9715decf419ad394fc Mon Sep 17 00:00:00 2001 From: sheroze1123 Date: Sun, 16 Nov 2014 00:12:52 -0500 Subject: [PATCH 2/2] Conformed the 100 char limit and changed colon to semicolon --- src/librustc/middle/typeck/check/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 141dd22f7e35f..0d1ebac54c153 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2534,7 +2534,8 @@ fn lookup_method_for_for_loop(fcx: &FnCtxt, let ty_string = fcx.infcx().ty_to_string(true_expr_type); fcx.tcx().sess.span_err(iterator_expr.span, format!("`for` loop expression has type `{}` which does \ - not implement the `Iterator` trait: maybe try .iter()", + not implement the `Iterator` trait; \ + maybe try .iter()", ty_string).as_slice()); } ty::mk_err()