Update E0379 to new format #35338

This commit is contained in:
kc1212 2016-08-05 22:52:57 +12:00
parent 802d0811a5
commit 764d5cfafb
2 changed files with 6 additions and 2 deletions

View 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()
}
}
}

View 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() { }