Revert "Update Rust nightly to 1.19.0-nightly (6165203c4 2017-06-03)"

This reverts commit f081380dc0.
This commit is contained in:
Anthony Ramine 2017-06-03 14:37:17 +02:00
parent befb017f7f
commit 56c961af5a
6 changed files with 16 additions and 9 deletions

View file

@ -140,16 +140,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
if !in_derive_expn(span) {
let def_id = cx.tcx.hir.local_def_id(id);
let sig = cx.tcx.type_of(def_id).fn_sig();
let ty = cx.tcx.type_of(def_id);
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().0.iter()) {
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.span, "Type must be rooted")
}
}
if !in_new_function {
if is_unrooted_ty(cx, sig.output().0, false) {
if is_unrooted_ty(cx, ty.fn_ret().0, false) {
cx.span_lint(UNROOTED_MUST_ROOT, decl.output.span(), "Type must be rooted")
}
}
@ -218,8 +218,15 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
visit::walk_pat(self, pat);
}
fn visit_ty(&mut self, _: &'tcx hir::Ty) {}
fn visit_fn(&mut self, kind: visit::FnKind<'tcx>, decl: &'tcx hir::FnDecl,
body: hir::BodyId, span: codemap::Span, id: ast::NodeId) {
if let visit::FnKind::Closure(_) = kind {
visit::walk_fn(self, kind, decl, body, span, id);
}
}
fn visit_foreign_item(&mut self, _: &'tcx hir::ForeignItem) {}
fn visit_ty(&mut self, _: &'tcx hir::Ty) { }
fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> {
hir::intravisit::NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir)
}