Rust upgrade to rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)
This commit is contained in:
parent
387efd459c
commit
0ca166277c
@ -1604,7 +1604,7 @@ fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
|
||||
fn is_iterable_array(ty: Ty) -> bool {
|
||||
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
|
||||
match ty.sty {
|
||||
ty::TyArray(_, n) => (0...32).contains(const_to_u64(n)),
|
||||
ty::TyArray(_, n) => (0..=32).contains(const_to_u64(n)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ impl<'a> Sugg<'a> {
|
||||
ast::ExprKind::While(..) |
|
||||
ast::ExprKind::WhileLet(..) => Sugg::NonParen(snippet),
|
||||
ast::ExprKind::Range(.., RangeLimits::HalfOpen) => Sugg::BinOp(AssocOp::DotDot, snippet),
|
||||
ast::ExprKind::Range(.., RangeLimits::Closed) => Sugg::BinOp(AssocOp::DotDotDot, snippet),
|
||||
ast::ExprKind::Range(.., RangeLimits::Closed) => Sugg::BinOp(AssocOp::DotDotEq, snippet),
|
||||
ast::ExprKind::Assign(..) => Sugg::BinOp(AssocOp::Assign, snippet),
|
||||
ast::ExprKind::AssignOp(op, ..) => Sugg::BinOp(astbinop2assignop(op), snippet),
|
||||
ast::ExprKind::Binary(op, ..) => Sugg::BinOp(AssocOp::from_ast_binop(op.node), snippet),
|
||||
@ -165,7 +165,7 @@ impl<'a> Sugg<'a> {
|
||||
pub fn range(self, end: Self, limit: ast::RangeLimits) -> Sugg<'static> {
|
||||
match limit {
|
||||
ast::RangeLimits::HalfOpen => make_assoc(AssocOp::DotDot, &self, &end),
|
||||
ast::RangeLimits::Closed => make_assoc(AssocOp::DotDotDot, &self, &end),
|
||||
ast::RangeLimits::Closed => make_assoc(AssocOp::DotDotEq, &self, &end),
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,7 +312,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg, rhs: &Sugg) -> Sugg<'static> {
|
||||
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, token_to_string(&token::BinOp(op)), rhs),
|
||||
AssocOp::As => format!("{} as {}", lhs, rhs),
|
||||
AssocOp::DotDot => format!("{}..{}", lhs, rhs),
|
||||
AssocOp::DotDotDot => format!("{}...{}", lhs, rhs),
|
||||
AssocOp::DotDotEq => format!("{}...{}", lhs, rhs),
|
||||
AssocOp::Colon => format!("{}: {}", lhs, rhs),
|
||||
};
|
||||
|
||||
@ -362,7 +362,7 @@ fn associativity(op: &AssocOp) -> Associativity {
|
||||
ShiftLeft |
|
||||
ShiftRight |
|
||||
Subtract => Associativity::Left,
|
||||
DotDot | DotDotDot => Associativity::None,
|
||||
DotDot | DotDotEq => Associativity::None,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user