Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30)

This commit is contained in:
Simon Sapin 2015-07-30 16:58:26 +02:00
parent a3c0366bd6
commit 930921b0c3
7 changed files with 170 additions and 77 deletions

View file

@ -22,7 +22,7 @@ impl LintPass for StrToStringPass {
fn check_expr(&mut self, cx: &Context, expr: &ast::Expr) {
match expr.node {
ast::ExprMethodCall(ref method, _, ref args)
if method.node.as_str() == "to_string"
if method.node.name.as_str() == "to_string"
&& is_str(cx, &*args[0]) => {
cx.span_lint(STR_TO_STRING, expr.span,
"str.to_owned() is more efficient than str.to_string(), please use it instead");

View file

@ -121,9 +121,9 @@ impl LintPass for UnrootedPass {
block: &ast::Block, _span: codemap::Span, id: ast::NodeId) {
match kind {
visit::FkItemFn(i, _, _, _, _, _) |
visit::FkMethod(i, _, _) if i.as_str() == "new"
|| i.as_str() == "new_inherited"
|| i.as_str() == "new_initialized" => {
visit::FkMethod(i, _, _) if i.name.as_str() == "new"
|| i.name.as_str() == "new_inherited"
|| i.name.as_str() == "new_initialized" => {
self.in_new_function = true;
return;
},