diff --git a/compiler/rustc_lint/src/function_cast_as_integer.rs b/compiler/rustc_lint/src/function_cast_as_integer.rs index 279e8b8c3ba4..2a4ff1f63db5 100644 --- a/compiler/rustc_lint/src/function_cast_as_integer.rs +++ b/compiler/rustc_lint/src/function_cast_as_integer.rs @@ -39,6 +39,9 @@ impl<'tcx> LateLintPass<'tcx> for FunctionCastsAsInteger { let hir::ExprKind::Cast(cast_from_expr, cast_to_expr) = expr.kind else { return }; let cast_to_ty = cx.typeck_results().expr_ty(expr); // Casting to a function (pointer?), so all good. + // + // Normally, only casts to integers is possible, but if it ever changed, this condition + // will likely need to be updated. if matches!(cast_to_ty.kind(), ty::FnDef(..) | ty::FnPtr(..) | ty::RawPtr(..)) { return; }