Skip to content

Commit 7d38373

Browse files
committed
Skip analysis for closures defined in skipped defs
1 parent cd5f2cc commit 7d38373

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/analyze/crate_.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
100100
return;
101101
}
102102

103+
// skip analysis if the def is closure defined in skipped def
104+
if let Some(root_local_def_id) = self
105+
.tcx
106+
.typeck_root_def_id(local_def_id.to_def_id())
107+
.as_local()
108+
{
109+
if root_local_def_id != local_def_id && self.skip_analysis.contains(&root_local_def_id)
110+
{
111+
self.skip_analysis.insert(local_def_id);
112+
return;
113+
}
114+
}
115+
103116
let target_def_id = if analyzer.is_annotated_as_extern_spec_fn() {
104117
analyzer.extern_spec_fn_target_def_id()
105118
} else {

0 commit comments

Comments
 (0)