From f831b0979e6a694c499c37570252fe787e04123c Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 9 Jul 2019 14:48:48 +0200 Subject: [PATCH] cast_ptr_alignment: Mention legal use under known problems Refs #2881. --- clippy_lints/src/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index b674b3888ab..7b1d832f249 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -789,7 +789,8 @@ fn is_unit_literal(expr: &Expr) -> bool { /// **Why is this bad?** Dereferencing the resulting pointer may be undefined /// behavior. /// - /// **Known problems:** None. + /// **Known problems:** Using `std::ptr::read_unaligned` and `std::ptr::write_unaligned` or similar + /// on the resulting pointer is fine. /// /// **Example:** /// ```rust