Skip to content

Update E0379 to new format #35338 #35364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
@@ -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()
}
}
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/const-fn-mismatch.rs
Original file line number Diff line number Diff line change
@@ -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() { }