Update E0010 to use the new format

For https://github.com/rust-lang/rust/issues/35194
This commit is contained in:
Peter C. Norton 2016-08-06 19:23:40 -04:00
parent 4c02363852
commit dfb66c3e2b
2 changed files with 5 additions and 2 deletions

View File

@ -686,8 +686,10 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'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();
}
}

View File

@ -11,5 +11,6 @@
#![feature(box_syntax)]
const CON : Box<i32> = box 0; //~ ERROR E0010
//~| NOTE allocation not allowed in
fn main() {}