rust-lang/rust-clippy

Lint `static mut FOO: T` where `T` has a safe counterpart

Open

#4,070 创建于 2019年5月8日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Rust (1,391 fork)batch import
A-lintL-correctnessgood first issue

仓库指标

Star
 (10,406 star)
PR 合并指标
 (平均合并 19天 22小时) (30 天内合并 113 个 PR)

描述

There is no reason to ever write static mut FOO: u32. Instead one should use static FOO: AtomicU32 which does the same thing, is just as efficient and requires no unsafe code.

We should lint this for at least

  • u8, u16, u32, u64
  • i8, i16, i32, i64
  • isize, usize
  • bool
  • *mut T

贡献者指南