Skip to content

Commit b7711bf

Browse files
committed
Rename is_range_literal to is_lit
1 parent 80f90d8 commit b7711bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/hir/lowering.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5423,7 +5423,7 @@ pub fn is_range_literal(sess: &Session, expr: &hir::Expr) -> bool {
54235423

54245424
// Check whether a span corresponding to a range expression is a
54255425
// range literal, rather than an explicit struct or `new()` call.
5426-
fn is_range_literal(sess: &Session, span: &Span) -> bool {
5426+
fn is_lit(sess: &Session, span: &Span) -> bool {
54275427
let source_map = sess.source_map();
54285428
let end_point = source_map.end_point(*span);
54295429

@@ -5438,21 +5438,21 @@ pub fn is_range_literal(sess: &Session, expr: &hir::Expr) -> bool {
54385438
// All built-in range literals but `..=` and `..` desugar to `Struct`s.
54395439
ExprKind::Struct(ref qpath, _, _) => {
54405440
if let QPath::Resolved(None, ref path) = **qpath {
5441-
return is_range_path(&path) && is_range_literal(sess, &expr.span);
5441+
return is_range_path(&path) && is_lit(sess, &expr.span);
54425442
}
54435443
}
54445444

54455445
// `..` desugars to its struct path.
54465446
ExprKind::Path(QPath::Resolved(None, ref path)) => {
5447-
return is_range_path(&path) && is_range_literal(sess, &expr.span);
5447+
return is_range_path(&path) && is_lit(sess, &expr.span);
54485448
}
54495449

54505450
// `..=` desugars into `::std::ops::RangeInclusive::new(...)`.
54515451
ExprKind::Call(ref func, _) => {
54525452
if let ExprKind::Path(QPath::TypeRelative(ref ty, ref segment)) = func.node {
54535453
if let TyKind::Path(QPath::Resolved(None, ref path)) = ty.node {
54545454
let new_call = segment.ident.as_str() == "new";
5455-
return is_range_path(&path) && is_range_literal(sess, &expr.span) && new_call;
5455+
return is_range_path(&path) && is_lit(sess, &expr.span) && new_call;
54565456
}
54575457
}
54585458
}

0 commit comments

Comments
 (0)