File tree 1 file changed +8
-5
lines changed
compiler/rustc_monomorphize/src/mono_checks
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> {
148
148
span : Span ,
149
149
) {
150
150
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
+
156
152
let lint_root = source_info. scope . lint_root ( & self . body . source_scopes ) ;
157
153
let Some ( lint_root) = lint_root else {
158
154
// This happens when the issue is in a function from a foreign crate that
@@ -172,6 +168,12 @@ impl<'tcx> MoveCheckVisitor<'tcx> {
172
168
. map ( |( _, call_site) | call_site)
173
169
. unwrap_or ( span) ;
174
170
171
+ for previously_reported_span in & self . move_size_spans {
172
+ if previously_reported_span. overlaps ( reported_span) {
173
+ return ;
174
+ }
175
+ }
176
+
175
177
self . tcx . emit_node_span_lint (
176
178
LARGE_ASSIGNMENTS ,
177
179
lint_root,
@@ -182,6 +184,7 @@ impl<'tcx> MoveCheckVisitor<'tcx> {
182
184
limit : limit as u64 ,
183
185
} ,
184
186
) ;
187
+
185
188
self . move_size_spans . push ( reported_span) ;
186
189
}
187
190
}
You can’t perform that action at this time.
0 commit comments