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) {
struct_span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method")
- .span_label(span, &format!("call to destructor method"))
+ .span_label(span, &format!("explicit destructor calls not allowed"))
.emit();
}
}
// set up all the node type bindings.
error_fn_sig = ty::Binder(ty::FnSig {
inputs: self.err_args(arg_exprs.len()),
- output: ty::FnConverging(self.tcx.types.err),
+ output: self.tcx.types.err,
variadic: false
});
fcx.demand_eqtype(self.call_expr.span, self_arg_ty, method_arg_ty);
}
- let nilty = fcx.tcx.mk_nil();
fcx.demand_eqtype(self.call_expr.span,
- method_sig.output.unwrap_or(nilty),
- self.fn_sig.output.unwrap_or(nilty));
+ method_sig.output,
+ self.fn_sig.output);
fcx.write_overloaded_call_method_map(self.call_expr, method_callee);
}