rust-lang/rust-clippy

Politely mention that `Box<&T>` is almost the most useless type you can have

Open

#2.394 geöffnet am 23. Jan. 2018

Auf GitHub ansehen
 (25 Kommentare) (21 Reaktionen) (1 zugewiesene Person)Rust (1.391 Forks)batch import
A-lintT-middlegood first issue

Repository-Metriken

Stars
 (10.406 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 19T 22h) (113 gemergte PRs in 30 T)

Beschreibung

Found in the wild: https://stackoverflow.com/questions/48406077/mutation-of-a-variable-inside-while-loop

List of types that make no sense that we should be linting about:

  • Box<&T>
  • Box::new(SomeT) where sizeof::<T>() <= sizeof::<usize>()
    • unless there are Box::into_raw calls within the function
  • Rc<Box<T>>
  • Rc<Rc<T>>
  • Rc<&T>
  • more...?

Contributor Guide