Skip to content

Commit e5a4a7a

Browse files
committed
Updates compiler error E0040 with new format
1 parent 545a3a9 commit e5a4a7a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc_typeck/check/callee.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ use rustc::hir;
2828
/// method that is called)
2929
pub fn check_legal_trait_for_method_call(ccx: &CrateCtxt, span: Span, trait_id: DefId) {
3030
if ccx.tcx.lang_items.drop_trait() == Some(trait_id) {
31-
span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method");
31+
struct_span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method")
32+
.span_label(span, &format!("call to destructor method"))
33+
.emit();
3234
}
3335
}
3436

src/test/compile-fail/E0040.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ impl Drop for Foo {
2020

2121
fn main() {
2222
let mut x = Foo { x: -7 };
23-
x.drop(); //~ ERROR E0040
23+
x.drop();
24+
//~^ ERROR E0040
25+
//~| NOTE call to destructor method
2426
}

0 commit comments

Comments
 (0)