Skip to content

Commit 705b484

Browse files
committed
Rename BinOpKind::lazy as BinOpKind::is_lazy.
To match `BinOpKind::is_comparison` and `hir::BinOpKind::is_lazy`.
1 parent 0efd2a9 commit 705b484

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

compiler/rustc_ast/src/ast.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ impl BinOpKind {
881881
Gt => ">",
882882
}
883883
}
884-
pub fn lazy(&self) -> bool {
884+
885+
pub fn is_lazy(&self) -> bool {
885886
matches!(self, BinOpKind::And | BinOpKind::Or)
886887
}
887888

compiler/rustc_lint/src/unused.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ trait UnusedDelimLint {
656656
) -> bool {
657657
if followed_by_else {
658658
match inner.kind {
659-
ast::ExprKind::Binary(op, ..) if op.node.lazy() => return true,
659+
ast::ExprKind::Binary(op, ..) if op.node.is_lazy() => return true,
660660
_ if classify::expr_trailing_brace(inner).is_some() => return true,
661661
_ => {}
662662
}
@@ -1016,7 +1016,7 @@ impl UnusedDelimLint for UnusedParens {
10161016
rustc_span::source_map::Spanned { node, .. },
10171017
_,
10181018
_,
1019-
) if node.lazy()))
1019+
) if node.is_lazy()))
10201020
{
10211021
self.emit_unused_delims_expr(cx, value, ctx, left_pos, right_pos, is_kw)
10221022
}

compiler/rustc_parse/src/parser/stmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ impl<'a> Parser<'a> {
384384

385385
fn check_let_else_init_bool_expr(&self, init: &ast::Expr) {
386386
if let ast::ExprKind::Binary(op, ..) = init.kind {
387-
if op.node.lazy() {
387+
if op.node.is_lazy() {
388388
self.sess.emit_err(errors::InvalidExpressionInLetElse {
389389
span: init.span,
390390
operator: op.node.as_str(),

0 commit comments

Comments
 (0)