Updated E0493 to new format.

This commit is contained in:
Federico Ravasio 2016-08-28 12:51:00 +02:00
parent 824000aee3
commit 638b7c89e6
2 changed files with 7 additions and 1 deletions

View File

@ -252,11 +252,15 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
let mut err =
struct_span_err!(self.tcx.sess, self.span, E0493, "{}", msg);
if self.mode != Mode::Const {
help!(&mut err,
"in Nightly builds, add `#![feature(drop_types_in_const)]` \
to the crate attributes to enable");
} else {
err.span_label(self.span, &format!("constants cannot have destructors"));
}
err.emit();
}

View File

@ -16,7 +16,9 @@ impl Drop for Foo {
fn drop(&mut self) {}
}
const F : Foo = Foo { a : 0 }; //~ ERROR E0493
const F : Foo = Foo { a : 0 };
//~^ ERROR constants are not allowed to have destructors [E0493]
//~| NOTE constants cannot have destructors
fn main() {
}