Updates compiler error E0040 with new format

This commit is contained in:
Yojan Shrestha 2016-08-04 22:46:59 -05:00
parent 545a3a94fc
commit b564c6a5e4
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,9 @@ use rustc::hir;
/// method that is called)
pub fn check_legal_trait_for_method_call(ccx: &CrateCtxt, span: Span, trait_id: DefId) {
if ccx.tcx.lang_items.drop_trait() == Some(trait_id) {
span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method");
struct_span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method")
.span_label(span, &format!("call to destructor method"))
.emit();
}
}

View File

@ -20,5 +20,7 @@ impl Drop for Foo {
fn main() {
let mut x = Foo { x: -7 };
x.drop(); //~ ERROR E0040
x.drop();
//~^ ERROR E0040
//~| NOTE call to destructor method
}