Skip to content

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

Open
@oli-obk

Description

@oli-obk

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

Metadata

Metadata

Assignees

Labels

A-lintArea: New lintsT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions