mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-18 15:08:47 +00:00
Fix #2247
This commit is contained in:
parent
ad63e4eaef
commit
0b0337d258
2 changed files with 12 additions and 1 deletions
|
@ -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
9
tests/ui/ty_fn_sig.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// Regression test
|
||||||
|
|
||||||
|
pub fn retry<F: Fn()>(f: F) {
|
||||||
|
for _i in 0.. {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Reference in a new issue