]> git.lizzy.rs Git - rust.git/commitdiff
review comment: add extra doc
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 17 Apr 2019 23:42:52 +0000 (16:42 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Wed, 17 Apr 2019 23:42:52 +0000 (16:42 -0700)
src/librustc_typeck/check/op.rs

index 46c81d34d1b678e26445245fbe21fce7ae431335..b93ed2426b7038de8234774d12203962d54984dd 100644 (file)
@@ -430,6 +430,8 @@ fn check_overloaded_binop(&self,
         (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 @@ fn add_type_neq_err_label(
         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();