rust-lang/rust-clippy

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

Open

#4.070 aberto em 8 de mai. de 2019

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)Rust (1.391 forks)batch import
A-lintL-correctnessgood first issue

Métricas do repositório

Stars
 (10.406 stars)
Métricas de merge de PR
 (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)

Description

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

Guia do colaborador