mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30)
This commit is contained in:
parent
a3c0366bd6
commit
930921b0c3
7 changed files with 170 additions and 77 deletions
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue