large_assignments: Allow moves into functions
Moves into functions are typically implemented with pointer passing rather than memcpy's at the llvm-ir level, so allow moves into functions.
This commit is contained in:
parent
1a0200ebc0
commit
e2979a8b8c
7 changed files with 66 additions and 17 deletions
|
@ -666,7 +666,15 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
|
|||
debug!(?def_id, ?fn_span);
|
||||
|
||||
for arg in args {
|
||||
if let Some(too_large_size) = self.operand_size_if_too_large(limit, &arg.node) {
|
||||
// Moving args into functions is typically implemented with pointer
|
||||
// passing at the llvm-ir level and not by memcpy's. So always allow
|
||||
// moving args into functions.
|
||||
let operand: &mir::Operand<'tcx> = &arg.node;
|
||||
if let mir::Operand::Move(_) = operand {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(too_large_size) = self.operand_size_if_too_large(limit, operand) {
|
||||
self.lint_large_assignment(limit.0, too_large_size, location, arg.span);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue