Skip to content

Commit

Permalink
Update E0010 to use the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
pcn committed Aug 7, 2016
1 parent 4c02363 commit dfb66c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,10 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
Rvalue::Box(_) => {
self.add(Qualif::NOT_CONST);
if self.mode != Mode::Fn {
span_err!(self.tcx.sess, self.span, E0010,
"allocations are not allowed in {}s", self.mode);
struct_span_err!(self.tcx.sess, self.span, E0010,
"allocations are not allowed in {}s", self.mode)
.span_label(self.span, &format!("allocation not allowed in {}s", self.mode))
.emit();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0010.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
#![feature(box_syntax)]

const CON : Box<i32> = box 0; //~ ERROR E0010
//~| NOTE allocation not allowed in

fn main() {}

0 comments on commit dfb66c3

Please sign in to comment.