about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/ptr.rs2
-rw-r--r--tests/ui/crashes/ice-8386.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs
index 77bf5f002f7..5c13f660c6b 100644
--- a/clippy_lints/src/ptr.rs
+++ b/clippy_lints/src/ptr.rs
@@ -649,7 +649,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args:
                     },
                     _ => {
                         skip_count += 1;
-                        results[arg.idx].skip = true;
+                        results[i].skip = true;
                         None
                     },
                 }
diff --git a/tests/ui/crashes/ice-8386.rs b/tests/ui/crashes/ice-8386.rs
new file mode 100644
index 00000000000..3e38b1408d8
--- /dev/null
+++ b/tests/ui/crashes/ice-8386.rs
@@ -0,0 +1,3 @@
+fn f(x: u32, mut arg: &String) {}
+
+fn main() {}