]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #35528 - Vassah:master, r=jonathandturner
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Thu, 11 Aug 2016 13:33:59 +0000 (06:33 -0700)
committerGitHub <noreply@github.com>
Thu, 11 Aug 2016 13:33:59 +0000 (06:33 -0700)
Update Error Format for E0091 and E0092

Addresses [#35228](https://github.com/rust-lang/rust/issues/35228) and [#35229](https://github.com/rust-lang/rust/issues/35229) as part of [#35233](https://github.com/rust-lang/rust/issues/35233).

Please let me know if there are any issues; first time contributor.

r? @jonathandturner

src/librustc_typeck/check/intrinsic.rs
src/librustc_typeck/check/mod.rs
src/test/compile-fail/E0091.rs
src/test/compile-fail/E0092.rs

index 8a53c59b4c7fad08dafbe1215cb6d8bf52914885..9051b1c8069bde3583af62b07cb215efd70b5f3f 100644 (file)
@@ -97,8 +97,10 @@ fn param<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, n: u32) -> Ty<'tcx> {
                 (0, Vec::new(), tcx.mk_nil())
             }
             op => {
-                span_err!(tcx.sess, it.span, E0092,
-                    "unrecognized atomic operation function: `{}`", op);
+                struct_span_err!(tcx.sess, it.span, E0092,
+                      "unrecognized atomic operation function: `{}`", op)
+                  .span_label(it.span, &format!("unrecognized atomic operation"))
+                  .emit();
                 return;
             }
         };
index 609ba31bae0d7267612f7f64d284a75062007d43..36fdba3706109682a0f4998040f50e00cd53c906 100644 (file)
@@ -4648,9 +4648,11 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
 
     for (i, b) in tps_used.iter().enumerate() {
         if !*b {
-            span_err!(ccx.tcx.sess, tps[i].span, E0091,
+            struct_span_err!(ccx.tcx.sess, tps[i].span, E0091,
                 "type parameter `{}` is unused",
-                tps[i].name);
+                tps[i].name)
+                .span_label(tps[i].span, &format!("unused type parameter"))
+                .emit();
         }
     }
 }
index da988dbf819ac8c681a28d3bd4341c112c8e7d34..0d6c246de2a0e79f2c6e0f6d148165684820d556 100644 (file)
@@ -9,7 +9,9 @@
 // except according to those terms.
 
 type Foo<T> = u32; //~ ERROR E0091
+                   //~| NOTE unused type parameter
 type Foo2<A, B> = Box<A>; //~ ERROR E0091
+                          //~| NOTE unused type parameter
 
 fn main() {
 }
index b08164ac06d4235c0e95907f583406db6118efe9..c8bb31a7857ee1495ad17512b0af982cba14cac1 100644 (file)
@@ -11,7 +11,7 @@
 #![feature(intrinsics)]
 extern "rust-intrinsic" {
     fn atomic_foo(); //~ ERROR E0092
-}
+}                    //~| NOTE unrecognized atomic operation
 
 fn main() {
 }