about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-08-05 16:13:00 +0200
committerGitHub <noreply@github.com>2016-08-05 16:13:00 +0200
commitcd48161e2ca866ef05a076181225cb041c679994 (patch)
treea7bbee7dbd982192f704b4008c7744bfe98f6e55
parentdbef510f3c845606e9388b2d4c6a96ba5c35a1d6 (diff)
parent19e140b946010a165373ff4d95ba858b28ff192f (diff)
Rollup merge of #35359 - Archytaus:master, r=GuillaumeGomez
Updated E0391 and E0404 to new error format

Fixes #35341 and #35342 as part of #35233.

r? @GuillaumeGomez
-rw-r--r--src/librustc_resolve/lib.rs8
-rw-r--r--src/librustc_typeck/collect.rs1
-rw-r--r--src/test/compile-fail/issue-3907.rs1
-rw-r--r--src/test/compile-fail/issue-5035.rs1
-rw-r--r--src/test/ui/codemap_tests/two_files.stderr2
5 files changed, 11 insertions, 2 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index c1511b29c9e..b26e3b3819c 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -219,7 +219,13 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
                              name)
         }
         ResolutionError::IsNotATrait(name) => {
-            struct_span_err!(resolver.session, span, E0404, "`{}` is not a trait", name)
+            let mut err = struct_span_err!(resolver.session,
+                                           span,
+                                           E0404,
+                                           "`{}` is not a trait",
+                                           name);
+            err.span_label(span, &format!("not a trait"));
+            err
         }
         ResolutionError::UndeclaredTraitName(name, candidates) => {
             let mut err = struct_span_err!(resolver.session,
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index b5a04d1926b..cb9c0496246 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -184,6 +184,7 @@ impl<'a,'tcx> CrateCtxt<'a,'tcx> {
 
         let mut err = struct_span_err!(tcx.sess, span, E0391,
             "unsupported cyclic reference between types/traits detected");
+        err.span_label(span, &format!("cyclic reference"));
 
         match cycle[0] {
             AstConvRequest::GetItemTypeScheme(def_id) |
diff --git a/src/test/compile-fail/issue-3907.rs b/src/test/compile-fail/issue-3907.rs
index cbc09a028c2..93556577ad3 100644
--- a/src/test/compile-fail/issue-3907.rs
+++ b/src/test/compile-fail/issue-3907.rs
@@ -18,6 +18,7 @@ struct S {
 }
 
 impl Foo for S { //~ ERROR: `Foo` is not a trait
+                 //~| NOTE: not a trait
                  //~| NOTE: type aliases cannot be used for traits
     fn bar() { }
 }
diff --git a/src/test/compile-fail/issue-5035.rs b/src/test/compile-fail/issue-5035.rs
index 9648d64d1fb..c2154e8a6c0 100644
--- a/src/test/compile-fail/issue-5035.rs
+++ b/src/test/compile-fail/issue-5035.rs
@@ -11,6 +11,7 @@
 trait I {}
 type K = I;
 impl K for isize {} //~ ERROR: `K` is not a trait
+                    //~| NOTE: not a trait
                     //~| NOTE: aliases cannot be used for traits
 
 use ImportError; //~ ERROR unresolved
diff --git a/src/test/ui/codemap_tests/two_files.stderr b/src/test/ui/codemap_tests/two_files.stderr
index cf3f187af93..69560174346 100644
--- a/src/test/ui/codemap_tests/two_files.stderr
+++ b/src/test/ui/codemap_tests/two_files.stderr
@@ -2,7 +2,7 @@ error[E0404]: `Bar` is not a trait
   --> $DIR/two_files.rs:16:6
    |
 16 | impl Bar for Baz { }
-   |      ^^^
+   |      ^^^ not a trait
    |
    = note: type aliases cannot be used for traits