moved cast_ptr_alignment to pedantic and expanded documentation

This commit is contained in:
djugei 2020-05-31 15:41:33 +02:00
parent 7ea7cd165a
commit 0bcfae92f8
No known key found for this signature in database
GPG key ID: B00A9C2B7704EA9F

View file

@ -974,7 +974,8 @@ declare_clippy_lint! {
/// behavior.
///
/// **Known problems:** Using `std::ptr::read_unaligned` and `std::ptr::write_unaligned` or similar
/// on the resulting pointer is fine.
/// on the resulting pointer is fine. Is over-zealous: Casts with manual alignment checks or casts like
/// u64-> u8 -> u16 can be fine. Miri is able to do a more in-depth analysis.
///
/// **Example:**
/// ```rust
@ -982,7 +983,7 @@ declare_clippy_lint! {
/// let _ = (&mut 1u8 as *mut u8) as *mut u16;
/// ```
pub CAST_PTR_ALIGNMENT,
correctness,
pedantic,
"cast from a pointer to a more-strictly-aligned pointer"
}