Rust upgrade to rustc 1.7.0-nightly (8ad12c3e2
2015-12-19)
This commit is contained in:
parent
9dca15de3e
commit
a65a7770b3
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.0.30"
|
version = "0.0.31"
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
"Andre Bogus <bogusandre@gmail.com>",
|
"Andre Bogus <bogusandre@gmail.com>",
|
||||||
|
|
|
@ -20,10 +20,8 @@ use syntax::ast::Lit_;
|
||||||
use syntax::ast::LitIntType::*;
|
use syntax::ast::LitIntType::*;
|
||||||
use syntax::ast::LitIntType;
|
use syntax::ast::LitIntType;
|
||||||
use syntax::ast::{UintTy, FloatTy, StrStyle};
|
use syntax::ast::{UintTy, FloatTy, StrStyle};
|
||||||
use syntax::ast::UintTy::*;
|
|
||||||
use syntax::ast::FloatTy::*;
|
use syntax::ast::FloatTy::*;
|
||||||
use syntax::ast::Sign::{self, Plus, Minus};
|
use syntax::ast::Sign::{self, Plus, Minus};
|
||||||
use syntax::ast_util;
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
||||||
|
@ -195,9 +193,9 @@ impl fmt::Display for Constant {
|
||||||
let (sign, suffix) = match *ity {
|
let (sign, suffix) = match *ity {
|
||||||
LitIntType::SignedIntLit(ref sity, ref sign) =>
|
LitIntType::SignedIntLit(ref sity, ref sign) =>
|
||||||
(if let Sign::Minus = *sign { "-" } else { "" },
|
(if let Sign::Minus = *sign { "-" } else { "" },
|
||||||
ast_util::int_ty_to_string(*sity)),
|
sity.ty_to_string()),
|
||||||
LitIntType::UnsignedIntLit(ref uity) =>
|
LitIntType::UnsignedIntLit(ref uity) =>
|
||||||
("", ast_util::uint_ty_to_string(*uity)),
|
("", uity.ty_to_string()),
|
||||||
LitIntType::UnsuffixedIntLit(ref sign) =>
|
LitIntType::UnsuffixedIntLit(ref sign) =>
|
||||||
(if let Sign::Minus = *sign { "-" } else { "" },
|
(if let Sign::Minus = *sign { "-" } else { "" },
|
||||||
"".into()),
|
"".into()),
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use rustc::lint::*;
|
use rustc::lint::*;
|
||||||
use syntax::codemap::Spanned;
|
use syntax::codemap::Spanned;
|
||||||
use syntax::ast::*;
|
use syntax::ast::*;
|
||||||
use syntax::ast_util::binop_to_string;
|
|
||||||
|
|
||||||
use utils::{span_lint, snippet};
|
use utils::{span_lint, snippet};
|
||||||
|
|
||||||
|
@ -38,17 +37,17 @@ impl EarlyLintPass for Precedence {
|
||||||
&format!("operator precedence can trip the unwary. \
|
&format!("operator precedence can trip the unwary. \
|
||||||
Consider parenthesizing your expression:\
|
Consider parenthesizing your expression:\
|
||||||
`({}) {} ({})`", snippet(cx, left.span, ".."),
|
`({}) {} ({})`", snippet(cx, left.span, ".."),
|
||||||
binop_to_string(op), snippet(cx, right.span, ".."))),
|
op.to_string(), snippet(cx, right.span, ".."))),
|
||||||
(true, false) => span_lint(cx, PRECEDENCE, expr.span,
|
(true, false) => span_lint(cx, PRECEDENCE, expr.span,
|
||||||
&format!("operator precedence can trip the unwary. \
|
&format!("operator precedence can trip the unwary. \
|
||||||
Consider parenthesizing your expression:\
|
Consider parenthesizing your expression:\
|
||||||
`({}) {} {}`", snippet(cx, left.span, ".."),
|
`({}) {} {}`", snippet(cx, left.span, ".."),
|
||||||
binop_to_string(op), snippet(cx, right.span, ".."))),
|
op.to_string(), snippet(cx, right.span, ".."))),
|
||||||
(false, true) => span_lint(cx, PRECEDENCE, expr.span,
|
(false, true) => span_lint(cx, PRECEDENCE, expr.span,
|
||||||
&format!("operator precedence can trip the unwary. \
|
&format!("operator precedence can trip the unwary. \
|
||||||
Consider parenthesizing your expression:\
|
Consider parenthesizing your expression:\
|
||||||
`{} {} ({})`", snippet(cx, left.span, ".."),
|
`{} {} ({})`", snippet(cx, left.span, ".."),
|
||||||
binop_to_string(op), snippet(cx, right.span, ".."))),
|
op.to_string(), snippet(cx, right.span, ".."))),
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue