Open
Description
I believe Clippy should catch both of the following casts but it currently only flags the first one.
unsafe fn frob(bytes: *const u8) -> *const String {
// Correctly caught by cast_ptr_alignment.
bytes as *const String
}
trait Trait {
unsafe fn frob(bytes: *const u8) -> *const Self where Self: Sized {
// Should be caught but is not.
bytes as *const Self
}
}
Would have prevented this bug in Chrome OS: https://bugs.chromium.org/p/chromium/issues/detail?id=900962.
clippy 0.0.212 (f5d868c 2018-11-15)