Updated E0493 to new format.
This commit is contained in:
parent
824000aee3
commit
638b7c89e6
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user