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 (10,406 star) (1,391 fork)batch import
A-lintT-middlegood first issue

描述

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

贡献者指南

Politely mention that `Box<&T>` is almost the most useless type you can have · rust-lang/rust-clippy#2394 | Good First Issue