about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-08-05 16:12:57 +0200
committerGitHub <noreply@github.com>2016-08-05 16:12:57 +0200
commit709fd096d661c006ce33abd8c643ec876dd23f0d (patch)
tree554300805d7f66f81cbf75523516f1b0c1e5b9e5
parent527e32675644a4f4d78d9d4242751a7cd1ab9a4d (diff)
parentee8d6b07091e762fbef8a3465806b48201ec5a2e (diff)
downloadrust-709fd096d661c006ce33abd8c643ec876dd23f0d.tar.gz
rust-709fd096d661c006ce33abd8c643ec876dd23f0d.zip
Rollup merge of #35294 - Roybie:35272-E0172-update-error-format, r=jonathandturner
Update error message for E0172

Fixes #35272 as part of #35233.

r? @jonathandturner
-rw-r--r--src/librustc_typeck/astconv.rs6
-rw-r--r--src/test/compile-fail/E0172.rs4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 3b2bca4ab39..744b4296ade 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1075,8 +1075,10 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
                         Ok((trait_ref, projection_bounds))
                     }
                     _ => {
-                        span_err!(self.tcx().sess, ty.span, E0172,
-                                  "expected a reference to a trait");
+                        struct_span_err!(self.tcx().sess, ty.span, E0172,
+                                  "expected a reference to a trait")
+                            .span_label(ty.span, &format!("expected a trait"))
+                            .emit();
                         Err(ErrorReported)
                     }
                 }
diff --git a/src/test/compile-fail/E0172.rs b/src/test/compile-fail/E0172.rs
index 7011bf0e937..485a31d9666 100644
--- a/src/test/compile-fail/E0172.rs
+++ b/src/test/compile-fail/E0172.rs
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo(bar: i32+std::fmt::Display) {} //~ ERROR E0172
+fn foo(bar: i32+std::fmt::Display) {}
+    //~^ ERROR E0172
+    //~| NOTE expected a trait
 
 fn main() {
 }