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 visit_expr(&mut self, e: &'tcx Expr<'_>) { }, _ => { 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() {}