rust-lang/rust-clippy

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

Open

#2.394 aberto em 23 de jan. de 2018

Ver no GitHub
 (25 comments) (21 reactions) (1 assignee)Rust (1.391 forks)batch import
A-lintT-middlegood 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

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...?

Guia do colaborador