rust-lang/rust-clippy

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

Open

#2,394 建立於 2018年1月23日

在 GitHub 查看
 (25 留言) (21 反應) (1 負責人)Rust (1,391 fork)batch import
A-lintT-middlegood first issue

倉庫指標

Star
 (10,406 star)
PR 合併指標
 (平均合併 19天 22小時) (30 天內合併 113 個 PR)

描述

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

貢獻者指南