mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Rename BinOpKind::lazy as BinOpKind::is_lazy.
To match `BinOpKind::is_comparison` and `hir::BinOpKind::is_lazy`.
This commit is contained in:
@@ -881,7 +881,8 @@ pub fn as_str(&self) -> &'static str {
|
||||
Gt => ">",
|
||||
}
|
||||
}
|
||||
pub fn lazy(&self) -> bool {
|
||||
|
||||
pub fn is_lazy(&self) -> bool {
|
||||
matches!(self, BinOpKind::And | BinOpKind::Or)
|
||||
}
|
||||
|
||||
|
||||
@@ -656,7 +656,7 @@ fn is_expr_delims_necessary(
|
||||
) -> bool {
|
||||
if followed_by_else {
|
||||
match inner.kind {
|
||||
ast::ExprKind::Binary(op, ..) if op.node.lazy() => return true,
|
||||
ast::ExprKind::Binary(op, ..) if op.node.is_lazy() => return true,
|
||||
_ if classify::expr_trailing_brace(inner).is_some() => return true,
|
||||
_ => {}
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ fn check_unused_delims_expr(
|
||||
rustc_span::source_map::Spanned { node, .. },
|
||||
_,
|
||||
_,
|
||||
) if node.lazy()))
|
||||
) if node.is_lazy()))
|
||||
{
|
||||
self.emit_unused_delims_expr(cx, value, ctx, left_pos, right_pos, is_kw)
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ fn parse_local(&mut self, attrs: AttrVec) -> PResult<'a, P<Local>> {
|
||||
|
||||
fn check_let_else_init_bool_expr(&self, init: &ast::Expr) {
|
||||
if let ast::ExprKind::Binary(op, ..) = init.kind {
|
||||
if op.node.lazy() {
|
||||
if op.node.is_lazy() {
|
||||
self.sess.emit_err(errors::InvalidExpressionInLetElse {
|
||||
span: init.span,
|
||||
operator: op.node.as_str(),
|
||||
|
||||
Reference in New Issue
Block a user