Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Dogfood fixes

This commit is contained in:
Manish Goregaokar 2017-01-04 15:48:34 -08:00
parent d6dd65620e
commit b101611a97
6 changed files with 14 additions and 14 deletions

View File

@ -58,9 +58,9 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
fn visit_expr(&mut self, expr: &'tcx Expr) {
if let ExprClosure(_, _, eid, _) = expr.node {
let body = self.cx.tcx.map.body(eid);
let expr = &body.value;
if matches!(expr.node, ExprBlock(_)) {
self.found_block = Some(&expr);
let ex = &body.value;
if matches!(ex.node, ExprBlock(_)) {
self.found_block = Some(ex);
return;
}
}

View File

@ -50,14 +50,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EtaPass {
fn check_closure(cx: &LateContext, expr: &Expr) {
if let ExprClosure(_, ref decl, eid, _) = expr.node {
let body = cx.tcx.map.body(eid);
let ref ex = body.value;
let ex = &body.value;
if let ExprCall(ref caller, ref args) = ex.node {
if args.len() != decl.inputs.len() {
// Not the same number of arguments, there
// is no way the closure is the same as the function
return;
}
if is_adjusted(cx, &ex) || args.iter().any(|arg| is_adjusted(cx, arg)) {
if is_adjusted(cx, ex) || args.iter().any(|arg| is_adjusted(cx, arg)) {
// Are the expression or the arguments type-adjusted? Then we need the closure
return;
}

View File

@ -102,7 +102,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
}
}
self.check_raw_ptr(cx, unsafety, decl, &body, nodeid);
self.check_raw_ptr(cx, unsafety, decl, body, nodeid);
}
fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
@ -114,7 +114,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
if let hir::TraitMethod::Provided(eid) = *eid {
let body = cx.tcx.map.body(eid);
self.check_raw_ptr(cx, sig.unsafety, &sig.decl, &body, item.id);
self.check_raw_ptr(cx, sig.unsafety, &sig.decl, body, item.id);
}
}
}
@ -141,9 +141,9 @@ impl<'a, 'tcx> Functions {
) {
let expr = &body.value;
if unsafety == hir::Unsafety::Normal && cx.access_levels.is_exported(nodeid) {
let raw_ptrs = iter_input_pats(&decl, body).zip(decl.inputs.iter())
.filter_map(|(arg, ty)| raw_ptr_arg(arg, ty))
.collect::<HashSet<_>>();
let raw_ptrs = iter_input_pats(decl, body).zip(decl.inputs.iter())
.filter_map(|(arg, ty)| raw_ptr_arg(arg, ty))
.collect::<HashSet<_>>();
if !raw_ptrs.is_empty() {
let mut v = DerefVisitor {

View File

@ -137,7 +137,7 @@ fn could_use_elision<'a, 'tcx: 'a, T: Iterator<Item = &'tcx Lifetime>>(
// extract lifetimes in input argument types
for arg in &func.inputs {
input_visitor.visit_ty(&arg);
input_visitor.visit_ty(arg);
}
// extract lifetimes in output type
if let Return(ref ty) = func.output {

View File

@ -92,7 +92,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
if in_external_macro(cx, body.value.span) {
return;
}
check_fn(cx, decl, &body);
check_fn(cx, decl, body);
}
}

View File

@ -97,7 +97,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypePass {
fn check_fn_decl(cx: &LateContext, decl: &FnDecl) {
for input in &decl.inputs {
check_ty(cx, &input);
check_ty(cx, input);
}
if let FunctionRetTy::Return(ref ty) = decl.output {
@ -651,7 +651,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeComplexityPass {
impl<'a, 'tcx> TypeComplexityPass {
fn check_fndecl(&self, cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl) {
for arg in &decl.inputs {
self.check_type(cx, &arg);
self.check_type(cx, arg);
}
if let Return(ref ty) = decl.output {
self.check_type(cx, ty);