]> git.lizzy.rs Git - rust.git/commitdiff
moved cast_ptr_alignment to pedantic and expanded documentation
authordjugei <ddjugei@gmail.com>
Sun, 31 May 2020 13:41:33 +0000 (15:41 +0200)
committerdjugei <ddjugei@gmail.com>
Sun, 31 May 2020 13:41:33 +0000 (15:41 +0200)
clippy_lints/src/types.rs

index 6ed9ff22e466482bd7d473cea7f40992e3d3ad02..3ac99e2468411885b1d783443862490f25c1dfec 100644 (file)
@@ -974,7 +974,8 @@ fn is_unit_literal(expr: &Expr<'_>) -> bool {
     /// 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 @@ fn is_unit_literal(expr: &Expr<'_>) -> bool {
     /// 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"
 }