large_assignments: Lint on specific large args passed to functions
This commit is contained in:
parent
16ba56c242
commit
8f440f06c6
5 changed files with 134 additions and 41 deletions
|
@ -229,6 +229,18 @@ impl<'tcx> Operand<'tcx> {
|
|||
Operand::Constant(c) => c.const_.ty(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn span<D: ?Sized>(&self, local_decls: &D) -> Span
|
||||
where
|
||||
D: HasLocalDecls<'tcx>,
|
||||
{
|
||||
match self {
|
||||
&Operand::Copy(ref l) | &Operand::Move(ref l) => {
|
||||
local_decls.local_decls()[l.local].source_info.span
|
||||
}
|
||||
Operand::Constant(c) => c.span,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> BinOp {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue