File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
compiler/rustc_monomorphize/src/mono_checks Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,7 @@ impl<'tcx> MoveCheckVisitor<'tcx> {
148148 span : Span ,
149149 ) {
150150 let source_info = self . body . source_info ( location) ;
151- for reported_span in & self . move_size_spans {
152- if reported_span. overlaps ( span) {
153- return ;
154- }
155- }
151+
156152 let lint_root = source_info. scope . lint_root ( & self . body . source_scopes ) ;
157153 let Some ( lint_root) = lint_root else {
158154 // This happens when the issue is in a function from a foreign crate that
@@ -172,6 +168,12 @@ impl<'tcx> MoveCheckVisitor<'tcx> {
172168 . map ( |( _, call_site) | call_site)
173169 . unwrap_or ( span) ;
174170
171+ for previously_reported_span in & self . move_size_spans {
172+ if previously_reported_span. overlaps ( reported_span) {
173+ return ;
174+ }
175+ }
176+
175177 self . tcx . emit_node_span_lint (
176178 LARGE_ASSIGNMENTS ,
177179 lint_root,
@@ -182,6 +184,7 @@ impl<'tcx> MoveCheckVisitor<'tcx> {
182184 limit : limit as u64 ,
183185 } ,
184186 ) ;
187+
185188 self . move_size_spans . push ( reported_span) ;
186189 }
187190}
You can’t perform that action at this time.
0 commit comments