Put a DefId in AggregateKind.

This commit is contained in:
Camille GILLOT 2023-01-23 22:15:33 +00:00
parent f3126500f2
commit 0241c29123
10 changed files with 33 additions and 17 deletions

View file

@ -126,6 +126,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
}
}
&AggregateKind::Closure(def_id, _) | &AggregateKind::Generator(def_id, _, _) => {
let def_id = def_id.expect_local();
let UnsafetyCheckResult { violations, used_unsafe_blocks, .. } =
self.tcx.unsafety_check_result(def_id);
self.register_violations(violations, used_unsafe_blocks.iter().copied());