Improve docs of fn_to_numeric_cast

Closes #2980
This commit is contained in:
Philipp Hansch 2018-10-04 18:09:09 +02:00
parent f42272102a
commit 7adf24ebb0
No known key found for this signature in database
GPG Key ID: B6FA06A6E0E2665B

View File

@ -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**
///