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:
commit
b69b2dbeb1
@ -28,7 +28,9 @@
|
||||
/// 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,5 +20,7 @@ fn drop(&mut self) {
|
||||
|
||||
fn main() {
|
||||
let mut x = Foo { x: -7 };
|
||||
x.drop(); //~ ERROR E0040
|
||||
x.drop();
|
||||
//~^ ERROR E0040
|
||||
//~| NOTE call to destructor method
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user