@@ -630,7 +630,7 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
630
630
let source_info = self . body . source_info ( location) ;
631
631
debug ! ( ?source_info) ;
632
632
633
- if let Some ( too_large_size) = self . operand_size_if_too_large ( limit, operand) {
633
+ if let Some ( too_large_size) = self . operand_size_if_too_large ( limit, operand, false ) {
634
634
self . lint_large_assignment ( limit. 0 , too_large_size, location, source_info. span ) ;
635
635
} ;
636
636
}
@@ -666,7 +666,7 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
666
666
debug ! ( ?def_id, ?fn_span) ;
667
667
668
668
for arg in args {
669
- if let Some ( too_large_size) = self . operand_size_if_too_large ( limit, & arg. node ) {
669
+ if let Some ( too_large_size) = self . operand_size_if_too_large ( limit, & arg. node , true ) {
670
670
self . lint_large_assignment ( limit. 0 , too_large_size, location, arg. span ) ;
671
671
} ;
672
672
}
@@ -676,7 +676,11 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
676
676
& mut self ,
677
677
limit : Limit ,
678
678
operand : & mir:: Operand < ' tcx > ,
679
+ allow_move : bool ,
679
680
) -> Option < Size > {
681
+ if allow_move && let mir:: Operand :: Move ( _) = operand {
682
+ return None ;
683
+ }
680
684
let ty = operand. ty ( self . body , self . tcx ) ;
681
685
let ty = self . monomorphize ( ty) ;
682
686
let Ok ( layout) = self . tcx . layout_of ( ty:: ParamEnv :: reveal_all ( ) . and ( ty) ) else {
0 commit comments