Skip to content

Commit 84af684

Browse files
committed
review comment: add extra doc
1 parent 8f77a03 commit 84af684

File tree

1 file changed

+3
-1
lines changed
  • src/librustc_typeck/check

1 file changed

+3
-1
lines changed

src/librustc_typeck/check/op.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
430430
(lhs_ty, rhs_ty, return_ty)
431431
}
432432

433+
/// If one of the types is an uncalled function and calling it would yield the other type,
434+
/// suggest calling the function. Returns wether a suggestion was given.
433435
fn add_type_neq_err_label(
434436
&self,
435437
err: &mut errors::DiagnosticBuilder<'_>,
@@ -438,7 +440,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
438440
other_ty: Ty<'tcx>,
439441
op: hir::BinOp,
440442
is_assign: IsAssign,
441-
) -> bool {
443+
) -> bool /* did we suggest to call a function because of missing parenthesis? */ {
442444
err.span_label(span, ty.to_string());
443445
if let FnDef(def_id, _) = ty.sty {
444446
let source_map = self.tcx.sess.source_map();

0 commit comments

Comments
 (0)