From 84af684b48d0380759f0722207bb6132a56ed61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Wed, 17 Apr 2019 16:42:52 -0700 Subject: [PATCH] review comment: add extra doc --- src/librustc_typeck/check/op.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 46c81d34d1b6..b93ed2426b70 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -430,6 +430,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { (lhs_ty, rhs_ty, return_ty) } + /// If one of the types is an uncalled function and calling it would yield the other type, + /// suggest calling the function. Returns wether a suggestion was given. fn add_type_neq_err_label( &self, err: &mut errors::DiagnosticBuilder<'_>, @@ -438,7 +440,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { other_ty: Ty<'tcx>, op: hir::BinOp, is_assign: IsAssign, - ) -> bool { + ) -> bool /* did we suggest to call a function because of missing parenthesis? */ { err.span_label(span, ty.to_string()); if let FnDef(def_id, _) = ty.sty { let source_map = self.tcx.sess.source_map();