]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/callee.rs
Auto merge of #35856 - phimuemue:master, r=brson
[rust.git] / src / librustc_typeck / check / callee.rs
index e73c3aa352b5605beec6fe6d8b1f164554360fbf..acb6653214dcbd8847d2db5ca4c34b4f68c94687 100644 (file)
@@ -29,7 +29,7 @@
 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();
     }
 }
@@ -213,7 +213,7 @@ fn confirm_builtin_call(&self,
                 // 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
                 });
 
@@ -345,10 +345,9 @@ fn resolve<'a>(&mut self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) {
                     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);
             }