Skip to content

Commit

Permalink
Rollup merge of rust-lang#35439 - pcn:update-E0010-error-message, r=j…
Browse files Browse the repository at this point in the history
…onathandturner

Update E0010 to use the new format

For rust-lang#35194
  • Loading branch information
Jonathan Turner committed Aug 7, 2016
2 parents 3917d0e + dfb66c3 commit 7d9ea8b
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 7d9ea8b

Please sign in to comment.