]> git.lizzy.rs Git - rust.git/commitdiff
Update E0379 to new format #35338
authorkc1212 <kc1212@users.noreply.github.com>
Fri, 5 Aug 2016 10:52:57 +0000 (22:52 +1200)
committerkc1212 <kc1212@users.noreply.github.com>
Fri, 5 Aug 2016 10:52:57 +0000 (22:52 +1200)
src/librustc_typeck/check/mod.rs
src/test/compile-fail/const-fn-mismatch.rs

index 6062bd048b3d27f8972edfbdce5efa766c448aab..8eafcbc83a248bb7c8d0c3bad5e5d34cef61e8db 100644 (file)
@@ -847,7 +847,9 @@ fn check_trait_fn_not_const<'a,'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
             // good
         }
         hir::Constness::Const => {
-            span_err!(ccx.tcx.sess, span, E0379, "trait fns cannot be declared const");
+            struct_span_err!(ccx.tcx.sess, span, E0379, "trait fns cannot be declared const")
+                .span_label(span, &format!("trait fns cannot be const"))
+                .emit()
         }
     }
 }
index d813cf32954e3349edcbfe5c1e21a7d3bb6af584..92568b27f7c1da143e24a4fd2a982f3df13026d7 100644 (file)
@@ -20,7 +20,9 @@ trait Foo {
 }
 
 impl Foo for u32 {
-    const fn f() -> u32 { 22 } //~ ERROR E0379
+    const fn f() -> u32 { 22 }
+    //~^ ERROR E0379
+    //~| NOTE trait fns cannot be const
 }
 
 fn main() { }