Skip to content

Commit

Permalink
review comment: add extra doc
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Apr 17, 2019
1 parent 8f77a03 commit 84af684
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_typeck/check/op.rs
Expand Up @@ -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<'_>,
Expand All @@ -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();
Expand Down

0 comments on commit 84af684

Please sign in to comment.