aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-02-22 18:22:41 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2016-02-23 02:43:57 +0100
commitdab9b4700cfd897f4558583328313ad6033bf2f8 (patch)
tree52c68be9e4ce2a1d9c07e3bfe2be4b80d9e90099 /components/plugins
parentef95eb3bbee76891dfdf4eac44a3647447f04cc9 (diff)
downloadservo-dab9b4700cfd897f4558583328313ad6033bf2f8.tar.gz
servo-dab9b4700cfd897f4558583328313ad6033bf2f8.zip
Bump to Rust 2016-02-22
Diffstat (limited to 'components/plugins')
-rw-r--r--components/plugins/jstraceable.rs5
-rw-r--r--components/plugins/lints/unrooted_must_root.rs2
-rw-r--r--components/plugins/reflector.rs5
-rw-r--r--components/plugins/url_plugin.rs6
-rw-r--r--components/plugins/utils.rs6
5 files changed, 11 insertions, 13 deletions
diff --git a/components/plugins/jstraceable.rs b/components/plugins/jstraceable.rs
index 3754be89fc8..b2b9746740c 100644
--- a/components/plugins/jstraceable.rs
+++ b/components/plugins/jstraceable.rs
@@ -2,8 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use syntax::ast;
-use syntax::ast::{MetaItem, Expr};
+use syntax::ast::{Expr, MetaItem, Mutability};
use syntax::codemap::Span;
use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::ext::build::AstBuilder;
@@ -50,7 +49,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
generics: ty::LifetimeBounds::empty(),
explicit_self: ty::borrowed_explicit_self(),
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js", "jsapi", "JSTracer"))),
- ty::Raw(ast::MutMutable))),
+ ty::Raw(Mutability::Mutable))),
ret_ty: ty::nil_ty(),
attributes: vec![quote_attr!(cx, #[inline])],
is_unsafe: false,
diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs
index b7d448d9f84..6c8b32698bd 100644
--- a/components/plugins/lints/unrooted_must_root.rs
+++ b/components/plugins/lints/unrooted_must_root.rs
@@ -206,7 +206,7 @@ impl<'a, 'b: 'a, 'tcx: 'a+'b> visit::Visitor<'a> for FnDefVisitor<'a, 'b, 'tcx>
fn visit_pat(&mut self, pat: &'a hir::Pat) {
let cx = self.cx;
- if let hir::PatIdent(hir::BindByValue(_), _, _) = pat.node {
+ if let hir::PatKind::Ident(hir::BindingMode::BindByValue(_), _, _) = pat.node {
if pat_is_binding(&cx.tcx.def_map.borrow(), pat) {
let ty = cx.tcx.pat_ty(pat);
if is_unrooted_ty(cx, ty, self.in_new_function) {
diff --git a/components/plugins/reflector.rs b/components/plugins/reflector.rs
index 826fb5f7636..660fd2a455d 100644
--- a/components/plugins/reflector.rs
+++ b/components/plugins/reflector.rs
@@ -2,8 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use syntax::ast;
-use syntax::ast::MetaItem;
+use syntax::ast::{ItemKind, MetaItem};
use syntax::codemap::Span;
use syntax::ext::base::{Annotatable, ExtCtxt};
use utils::match_ty_unwrap;
@@ -12,7 +11,7 @@ use utils::match_ty_unwrap;
pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable: &Annotatable,
push: &mut FnMut(Annotatable)) {
if let &Annotatable::Item(ref item) = annotatable {
- if let ast::ItemStruct(ref def, _) = item.node {
+ if let ItemKind::Struct(ref def, _) = item.node {
let struct_name = item.ident;
// This path has to be hardcoded, unfortunately, since we can't resolve paths at expansion time
match def.fields().iter().find(
diff --git a/components/plugins/url_plugin.rs b/components/plugins/url_plugin.rs
index 63f6ae777d1..9aa182068b3 100644
--- a/components/plugins/url_plugin.rs
+++ b/components/plugins/url_plugin.rs
@@ -4,7 +4,7 @@
use std::error::Error;
use syntax;
-use syntax::ast::{TokenTree, ExprLit, LitStr, Expr};
+use syntax::ast::{Expr, ExprKind, LitKind, TokenTree};
use syntax::codemap::Span;
use syntax::ext::base::{ExtCtxt, MacResult, MacEager, DummyResult};
use syntax::ext::build::AstBuilder;
@@ -53,8 +53,8 @@ pub fn expand_url(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
}
fn parse_str_lit(e: &Expr) -> Option<InternedString> {
- if let ExprLit(ref lit) = e.node {
- if let LitStr(ref s, _) = lit.node {
+ if let ExprKind::Lit(ref lit) = e.node {
+ if let LitKind::Str(ref s, _) = lit.node {
return Some(s.clone());
}
}
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs
index e7f9d6df930..29b09255936 100644
--- a/components/plugins/utils.rs
+++ b/components/plugins/utils.rs
@@ -18,7 +18,7 @@ use syntax::ptr::P;
/// Try not to use this for types defined in crates you own, use match_lang_ty instead (for lint passes)
pub fn match_ty_unwrap<'a>(ty: &'a ast::Ty, segments: &[&str]) -> Option<&'a [P<ast::Ty>]> {
match ty.node {
- ast::TyPath(_, ast::Path { segments: ref seg, .. }) => {
+ ast::TyKind::Path(_, ast::Path { segments: ref seg, .. }) => {
// So hir::Path isn't the full path, just the tokens that were provided.
// I could muck around with the maps and find the full path
// however the more efficient way is to simply reverse the iterators and zip them
@@ -60,9 +60,9 @@ pub fn match_lang_ty(cx: &LateContext, ty: &hir::Ty, value: &str) -> bool {
pub fn match_lang_did(cx: &LateContext, did: DefId, value: &str) -> bool {
cx.tcx.get_attrs(did).iter().any(|attr| {
match attr.node.value.node {
- ast::MetaNameValue(ref name, ref val) if &**name == "servo_lang" => {
+ ast::MetaItemKind::NameValue(ref name, ref val) if &**name == "servo_lang" => {
match val.node {
- ast::LitStr(ref v, _) if &**v == value => {
+ ast::LitKind::Str(ref v, _) if &**v == value => {
mark_used(attr);
true
},