mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Auto merge of #5667 - djugei:master, r=flip1995
moved cast_ptr_alignment to pedantic and expanded documentation fixes: #5618 changelog: cast_ptr_alignment moved to pedantic
This commit is contained in:
commit
8aa8f42556
3 changed files with 5 additions and 5 deletions
|
@ -1167,6 +1167,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&types::CAST_POSSIBLE_TRUNCATION),
|
||||
LintId::of(&types::CAST_POSSIBLE_WRAP),
|
||||
LintId::of(&types::CAST_PRECISION_LOSS),
|
||||
LintId::of(&types::CAST_PTR_ALIGNMENT),
|
||||
LintId::of(&types::CAST_SIGN_LOSS),
|
||||
LintId::of(&types::IMPLICIT_HASHER),
|
||||
LintId::of(&types::INVALID_UPCAST_COMPARISONS),
|
||||
|
@ -1413,7 +1414,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
|
||||
LintId::of(&types::BORROWED_BOX),
|
||||
LintId::of(&types::BOX_VEC),
|
||||
LintId::of(&types::CAST_PTR_ALIGNMENT),
|
||||
LintId::of(&types::CAST_REF_TO_MUT),
|
||||
LintId::of(&types::CHAR_LIT_AS_U8),
|
||||
LintId::of(&types::FN_TO_NUMERIC_CAST),
|
||||
|
@ -1673,7 +1673,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
|||
LintId::of(&transmute::WRONG_TRANSMUTE),
|
||||
LintId::of(&transmuting_null::TRANSMUTING_NULL),
|
||||
LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
|
||||
LintId::of(&types::CAST_PTR_ALIGNMENT),
|
||||
LintId::of(&types::CAST_REF_TO_MUT),
|
||||
LintId::of(&types::UNIT_CMP),
|
||||
LintId::of(&unicode::ZERO_WIDTH_SPACE),
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
|
|||
},
|
||||
Lint {
|
||||
name: "cast_ptr_alignment",
|
||||
group: "correctness",
|
||||
group: "pedantic",
|
||||
desc: "cast from a pointer to a more-strictly-aligned pointer",
|
||||
deprecation: None,
|
||||
module: "types",
|
||||
|
|
Loading…
Reference in a new issue