Skip to content

Commit 0bcfae9

Browse files
committed
moved cast_ptr_alignment to pedantic and expanded documentation
1 parent 7ea7cd1 commit 0bcfae9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/types.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,15 +974,16 @@ declare_clippy_lint! {
974974
/// behavior.
975975
///
976976
/// **Known problems:** Using `std::ptr::read_unaligned` and `std::ptr::write_unaligned` or similar
977-
/// on the resulting pointer is fine.
977+
/// on the resulting pointer is fine. Is over-zealous: Casts with manual alignment checks or casts like
978+
/// u64-> u8 -> u16 can be fine. Miri is able to do a more in-depth analysis.
978979
///
979980
/// **Example:**
980981
/// ```rust
981982
/// let _ = (&1u8 as *const u8) as *const u16;
982983
/// let _ = (&mut 1u8 as *mut u8) as *mut u16;
983984
/// ```
984985
pub CAST_PTR_ALIGNMENT,
985-
correctness,
986+
pedantic,
986987
"cast from a pointer to a more-strictly-aligned pointer"
987988
}
988989

0 commit comments

Comments
 (0)