From 7adf24ebb04641941e47a0582e61461163f929f4 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 4 Oct 2018 18:09:09 +0200 Subject: [PATCH] Improve docs of fn_to_numeric_cast Closes #2980 --- clippy_lints/src/types.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 5d26e477c82..f39a26db509 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -722,9 +722,12 @@ declare_clippy_lint! { /// **What it does:** Checks for casts of function pointers to something other than usize /// /// **Why is this bad?** -/// Depending on the system architechture, casting a function pointer to something other than -/// `usize` will result in incorrect pointer addresses. -/// `usize` will always be able to store the function pointer on the given architechture. +/// Casting a function pointer to anything other than usize/isize is not portable across +/// architectures, because you end up losing bits if the target type is too small or end up with a +/// bunch of extra bits that waste space and add more instructions to the final binary than +/// strictly necessary for the problem +/// +/// Casting to isize also doesn't make sense since there are no signed addresses. /// /// **Example** ///