This commit is contained in:
Oliver Schneider 2017-11-29 15:52:57 +01:00
parent ad63e4eaef
commit 0b0337d258
No known key found for this signature in database
GPG Key ID: A69F8D225B3AD7D9
2 changed files with 12 additions and 1 deletions

View File

@ -1668,7 +1668,9 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
self.visit_expr(expr); self.visit_expr(expr);
}, },
ExprCall(ref f, ref args) => { ExprCall(ref f, ref args) => {
for (ty, expr) in self.cx.tables.expr_ty(f).fn_sig(self.cx.tcx).inputs().skip_binder().iter().zip(args) { self.visit_expr(f);
for expr in args {
let ty = self.cx.tables.expr_ty_adjusted(expr);
self.prefer_mutable = false; self.prefer_mutable = false;
if let ty::TyRef(_, mutbl) = ty.sty { if let ty::TyRef(_, mutbl) = ty.sty {
if mutbl.mutbl == MutMutable { if mutbl.mutbl == MutMutable {

9
tests/ui/ty_fn_sig.rs Normal file
View File

@ -0,0 +1,9 @@
// Regression test
pub fn retry<F: Fn()>(f: F) {
for _i in 0.. {
f();
}
}
fn main() {}