fn check_no_chained_comparison(&mut self, lhs: &Expr, outer_op: &AssocOp) {
        debug_assert!(outer_op.is_comparison());
        match lhs.node {
            ExprKind::Binary(op, _, _) if op.node.is_comparison() => {
                // respan to include both operators
                let op_span = mk_sp(op.span.lo, self.span.hi);
                let mut err = self.diagnostic().struct_span_err(op_span,
                    "chained comparison operators require parentheses");
                if op.node == BinOpKind::Lt && *outer_op == AssocOp::Greater {
                    err.fileline_help(op_span,
                        "use `::<...>` instead of `<...>` if you meant to specify type arguments");
                }
                err.emit();
            }
            _ => {}
        }
    }
/// Produce an error if comparison operators are chained (RFC #558).
/// We only need to check lhs, not rhs, because all comparison ops
/// have same precedence and are left-associative
Produce an error if comparison operators are chained (RFC #558).
We only need to check lhs, not rhs, because all comparison ops
have same precedence and are left-associative
Produce an error if comparison operators are chained ( RFC #558 ) . We only need to check lhs not rhs because all comparison ops have same precedence and are left - associative
fn check_no_chained_comparison(&mut self, lhs: &Expr, outer_op: &AssocOp) {
        debug_assert!(outer_op.is_comparison());
        match lhs.node {
            ExprKind::Binary(op, _, _) if op.node.is_comparison() => {
                // respan to include both operators
                let op_span = mk_sp(op.span.lo, self.span.hi);
                let mut err = self.diagnostic().struct_span_err(op_span,
                    "chained comparison operators require parentheses");
                if op.node == BinOpKind::Lt && *outer_op == AssocOp::Greater {
                    err.fileline_help(op_span,
                        "use `::<...>` instead of `<...>` if you meant to specify type arguments");
                }
                err.emit();
            }
            _ => {}
        }
    }
fn check_no_chained_comparison ( & mut self , lhs : & Expr , outer_op : & AssocOp ) { debug_assert ! ( outer_op is_comparison ( ) ) ; match lhs . node { ExprKind :: Binary ( op , _ , _ ) if op . node . is_comparison ( ) => { // respan to include both operators let op_span = mk_sp ( op . span . lo , self . span . hi ) ; let mut err = self . diagnostic ( ) . struct_span_err ( op_span , " " ) ; if op . node == BinOpKind :: Lt && * outer_op == AssocOp :: Greater { err . fileline_help ( op_span , " " ) ; } err . emit ( ) ; } _ => { } } }
Produce an error if comparison operators are chained (RFC #558).
Produce an error if comparison operators are chained ( RFC #558 ) .
&mut self
lhs
&Expr
outer_op
&AssocOp
&mut self
lhs
&Expr
outer_op
&AssocOp