Skip to content

Commit 1f63b62

Browse files
committed
fixup! Add invalid null pointer usage lint.
1 parent ab317f5 commit 1f63b62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/ptr.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ fn check_invalid_ptr_usage<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
215215
if let ExprKind::Path(ref qpath) = fun.kind;
216216
if let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id();
217217
let fun_def_path = cx.get_def_path(fun_def_id).into_iter().map(Symbol::to_ident_string).collect::<Vec<_>>();
218-
if let Some(&(_, arg_indices)) = INVALID_NULL_PTR_USAGE_TABLE.iter().find(|&&(fn_path, _)| fn_path == &fun_def_path);
218+
if let Some(&(_, arg_indices)) = INVALID_NULL_PTR_USAGE_TABLE
219+
.iter()
220+
.find(|&&(fn_path, _)| fn_path == &fun_def_path);
219221
then {
220222
for &arg_idx in arg_indices {
221223
if let Some(arg) = args.get(arg_idx).filter(|arg| is_null_path(cx, arg)) {

0 commit comments

Comments
 (0)