diff options
| author | kc1212 <kc1212@users.noreply.github.com> | 2016-08-05 22:52:57 +1200 |
|---|---|---|
| committer | kc1212 <kc1212@users.noreply.github.com> | 2016-08-05 22:52:57 +1200 |
| commit | 764d5cfafb30acbe3fdb45b6c98b4e694a303558 (patch) | |
| tree | d1e817cb20fc1a780c20631b3833a65035a78979 | |
| parent | 802d0811a5a9fc26388dda1d54ea41a5b64a2466 (diff) | |
| download | rust-764d5cfafb30acbe3fdb45b6c98b4e694a303558.tar.gz rust-764d5cfafb30acbe3fdb45b6c98b4e694a303558.zip | |
Update E0379 to new format #35338
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/const-fn-mismatch.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 6062bd048b3..8eafcbc83a2 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -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() } } } diff --git a/src/test/compile-fail/const-fn-mismatch.rs b/src/test/compile-fail/const-fn-mismatch.rs index d813cf32954..92568b27f7c 100644 --- a/src/test/compile-fail/const-fn-mismatch.rs +++ b/src/test/compile-fail/const-fn-mismatch.rs @@ -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() { } |
