diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-12-23 16:24:06 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2017-01-02 10:51:02 +0100 |
commit | 37923f6f2a7edb5409d73d7fa4865f393a2af095 (patch) | |
tree | 12d22f61d7e980add5852a18653681d411fcaf96 | |
parent | e995af9cff24801e3c2441f00cf65157b7c61b2c (diff) | |
download | servo-37923f6f2a7edb5409d73d7fa4865f393a2af095.tar.gz servo-37923f6f2a7edb5409d73d7fa4865f393a2af095.zip |
Update to rustc 1.16.0-nightly (4ecc85beb 2016-12-28)
-rw-r--r-- | components/plugins/lints/unrooted_must_root.rs | 8 | ||||
-rw-r--r-- | components/plugins/utils.rs | 12 | ||||
-rw-r--r-- | rust-nightly-date | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/components/plugins/lints/unrooted_must_root.rs b/components/plugins/lints/unrooted_must_root.rs index 328b143593b..380e239fed2 100644 --- a/components/plugins/lints/unrooted_must_root.rs +++ b/components/plugins/lints/unrooted_must_root.rs @@ -123,7 +123,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { cx: &LateContext<'a, 'tcx>, kind: visit::FnKind, decl: &'tcx hir::FnDecl, - body: &'tcx hir::Expr, + body: &'tcx hir::Body, span: codemap::Span, id: ast::NodeId) { let in_new_function = match kind { @@ -140,7 +140,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { for (arg, ty) in decl.inputs.iter().zip(ty.fn_args().0.iter()) { if is_unrooted_ty(cx, ty, false) { - cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted") + cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted") } } @@ -155,7 +155,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { cx: cx, in_new_function: in_new_function, }; - visit::walk_expr(&mut visitor, body); + visit::walk_expr(&mut visitor, &body.value); } } @@ -215,7 +215,7 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { } fn visit_fn(&mut self, kind: visit::FnKind<'tcx>, decl: &'tcx hir::FnDecl, - body: hir::ExprId, span: codemap::Span, id: ast::NodeId) { + body: hir::BodyId, span: codemap::Span, id: ast::NodeId) { if let visit::FnKind::Closure(_) = kind { visit::walk_fn(self, kind, decl, body, span, id); } diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index f0d8a0edea8..cbda117d75c 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.rs @@ -23,10 +23,16 @@ pub fn match_ty_unwrap<'a>(ty: &'a ast::Ty, segments: &[&str]) -> Option<&'a [P< // which will compare them in reverse until one of them runs out of segments if seg.iter().rev().zip(segments.iter().rev()).all(|(a, b)| &*a.identifier.name.as_str() == *b) { match seg.last() { - Some(&ast::PathSegment { parameters: ast::PathParameters::AngleBracketed(ref a), .. }) => { - Some(&a.types) + Some(&ast::PathSegment { parameters: Some(ref params), .. }) => { + match **params { + ast::PathParameters::AngleBracketed(ref a) => Some(&a.types), + + // `Foo(A,B) -> C` + ast::PathParameters::Parenthesized(_) => None, + } } - _ => None + Some(&ast::PathSegment { parameters: None, .. }) => Some(&[]), + None => None, } } else { None diff --git a/rust-nightly-date b/rust-nightly-date index 0e3f208c6c6..ce804db01b4 100644 --- a/rust-nightly-date +++ b/rust-nightly-date @@ -1 +1 @@ -2016-12-19 +2016-12-29 |