diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-09-02 07:57:55 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-09-02 09:22:17 +0200 |
commit | 40b4348824f96a0f37b39f38a024b6061b36b0a7 (patch) | |
tree | 0c7b91cac0e789c3d53bf11fcda475037f1de0e5 /components/plugins/lints | |
parent | ba2cb77c26006dc378553d757e88de8ab86c4d5b (diff) | |
download | servo-40b4348824f96a0f37b39f38a024b6061b36b0a7.tar.gz servo-40b4348824f96a0f37b39f38a024b6061b36b0a7.zip |
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
Diffstat (limited to 'components/plugins/lints')
-rw-r--r-- | components/plugins/lints/inheritance_integrity.rs | 5 | ||||
-rw-r--r-- | components/plugins/lints/privatize.rs | 5 | ||||
-rw-r--r-- | components/plugins/lints/unrooted_must_root.rs | 10 |
3 files changed, 11 insertions, 9 deletions
diff --git a/components/plugins/lints/inheritance_integrity.rs b/components/plugins/lints/inheritance_integrity.rs index ab6dc2d1a1b..70fbed0c016 100644 --- a/components/plugins/lints/inheritance_integrity.rs +++ b/components/plugins/lints/inheritance_integrity.rs @@ -4,7 +4,8 @@ use rustc::lint::{Context, LintPass, LintArray, Level}; use rustc::middle::def; -use syntax::{ast, ast_util}; +use rustc::middle::def_id::DefId; +use syntax::ast; use utils::match_lang_ty; @@ -26,7 +27,7 @@ impl LintPass for InheritancePass { _gen: &ast::Generics, id: ast::NodeId) { // Lints are run post expansion, so it's fine to use // #[_dom_struct_marker] here without also checking for #[dom_struct] - if cx.tcx.has_attr(ast_util::local_def(id), "_dom_struct_marker") { + if cx.tcx.has_attr(DefId::local(id), "_dom_struct_marker") { // Find the reflector, if any let reflector_span = def.fields.iter().enumerate() .find(|&(ctr, f)| { diff --git a/components/plugins/lints/privatize.rs b/components/plugins/lints/privatize.rs index 7ef92eeaf30..a4a684b68ab 100644 --- a/components/plugins/lints/privatize.rs +++ b/components/plugins/lints/privatize.rs @@ -3,9 +3,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use rustc::lint::{Context, LintPass, LintArray}; +use rustc::middle::def_id::DefId; +use syntax::ast; use syntax::ast::Public; use syntax::attr::AttrMetaMethods; -use syntax::{ast, ast_util}; declare_lint!(PRIVATIZE, Deny, "Allows to enforce private fields for struct definitions"); @@ -27,7 +28,7 @@ impl LintPass for PrivatizePass { _i: ast::Ident, _gen: &ast::Generics, id: ast::NodeId) { - if cx.tcx.has_attr(ast_util::local_def(id), "privatize") { + if cx.tcx.has_attr(DefId::local(id), "privatize") { for field in &def.fields { match field.node { ast::StructField_ { kind: ast::NamedField(ident, visibility), .. } if visibility == Public => { diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index 9a94919556a..f20d5a43f2a 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -120,14 +120,14 @@ impl LintPass for UnrootedPass { fn check_fn(&mut self, cx: &Context, kind: visit::FnKind, decl: &ast::FnDecl, block: &ast::Block, _span: codemap::Span, id: ast::NodeId) { match kind { - visit::FkItemFn(i, _, _, _, _, _) | - visit::FkMethod(i, _, _) if i.name.as_str() == "new" - || i.name.as_str() == "new_inherited" - || i.name.as_str() == "new_initialized" => { + visit::FnKind::ItemFn(i, _, _, _, _, _) | + visit::FnKind::Method(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; }, - visit::FkItemFn(_, _, style, _, _, _) => match style { + visit::FnKind::ItemFn(_, _, style, _, _, _) => match style { ast::Unsafety::Unsafe => return, _ => () }, |