Skip to content

Commit dfb66c3

Browse files
committed
Update E0010 to use the new format
For #35194
1 parent 4c02363 commit dfb66c3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,10 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
686686
Rvalue::Box(_) => {
687687
self.add(Qualif::NOT_CONST);
688688
if self.mode != Mode::Fn {
689-
span_err!(self.tcx.sess, self.span, E0010,
690-
"allocations are not allowed in {}s", self.mode);
689+
struct_span_err!(self.tcx.sess, self.span, E0010,
690+
"allocations are not allowed in {}s", self.mode)
691+
.span_label(self.span, &format!("allocation not allowed in {}s", self.mode))
692+
.emit();
691693
}
692694
}
693695

src/test/compile-fail/E0010.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
#![feature(box_syntax)]
1212

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

1516
fn main() {}

0 commit comments

Comments
 (0)