Rollup merge of #35357 - shri3k:E0040, r=jonathandturner

Updates compiler error E0040 with new format

Addresses #35208 as part of #35233.
r? @GuillaumeGomez
This commit is contained in:
Jonathan Turner 2016-08-07 09:59:41 -07:00 committed by GitHub
commit b69b2dbeb1
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
}