Skip to content

Commit be27052

Browse files
committed
servo: Merge #14689 - Update to rustc 1.16.0-nightly (4ecc85beb 2016-12-28) (from servo:rustup); r=Manishearth
<s>**This is not ready to land** since there is no corresponding Nightly build of Rust yet.</s> Update: we got a Nightly build on 2016-12-29: http://rusty-dash.com/nightlies I made these changes to check that rust-lang/rust#38566 fixes rust-lang/rust#38535 (which it does, yay!) so I might as well publish them, we’ll need them soon enough. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 9bdd0f401a89398fb2ecd4f6b54691a7c93b2e53
1 parent b9674a7 commit be27052

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

servo/components/plugins/lints/unrooted_must_root.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
123123
cx: &LateContext<'a, 'tcx>,
124124
kind: visit::FnKind,
125125
decl: &'tcx hir::FnDecl,
126-
body: &'tcx hir::Expr,
126+
body: &'tcx hir::Body,
127127
span: codemap::Span,
128128
id: ast::NodeId) {
129129
let in_new_function = match kind {
@@ -140,7 +140,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
140140

141141
for (arg, ty) in decl.inputs.iter().zip(ty.fn_args().0.iter()) {
142142
if is_unrooted_ty(cx, ty, false) {
143-
cx.span_lint(UNROOTED_MUST_ROOT, arg.ty.span, "Type must be rooted")
143+
cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted")
144144
}
145145
}
146146

@@ -155,7 +155,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
155155
cx: cx,
156156
in_new_function: in_new_function,
157157
};
158-
visit::walk_expr(&mut visitor, body);
158+
visit::walk_expr(&mut visitor, &body.value);
159159
}
160160
}
161161

@@ -215,7 +215,7 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
215215
}
216216

217217
fn visit_fn(&mut self, kind: visit::FnKind<'tcx>, decl: &'tcx hir::FnDecl,
218-
body: hir::ExprId, span: codemap::Span, id: ast::NodeId) {
218+
body: hir::BodyId, span: codemap::Span, id: ast::NodeId) {
219219
if let visit::FnKind::Closure(_) = kind {
220220
visit::walk_fn(self, kind, decl, body, span, id);
221221
}

servo/components/plugins/utils.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ pub fn match_ty_unwrap<'a>(ty: &'a ast::Ty, segments: &[&str]) -> Option<&'a [P<
2323
// which will compare them in reverse until one of them runs out of segments
2424
if seg.iter().rev().zip(segments.iter().rev()).all(|(a, b)| &*a.identifier.name.as_str() == *b) {
2525
match seg.last() {
26-
Some(&ast::PathSegment { parameters: ast::PathParameters::AngleBracketed(ref a), .. }) => {
27-
Some(&a.types)
26+
Some(&ast::PathSegment { parameters: Some(ref params), .. }) => {
27+
match **params {
28+
ast::PathParameters::AngleBracketed(ref a) => Some(&a.types),
29+
30+
// `Foo(A,B) -> C`
31+
ast::PathParameters::Parenthesized(_) => None,
32+
}
2833
}
29-
_ => None
34+
Some(&ast::PathSegment { parameters: None, .. }) => Some(&[]),
35+
None => None,
3036
}
3137
} else {
3238
None

servo/rust-nightly-date

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2016-12-19
1+
2016-12-29

0 commit comments

Comments
 (0)