-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn'tL-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint group
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)
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn'tL-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint group