- for scope in &tcx.instance_mir(instance.def).source_scopes {
- if let Some((ref inlined, _)) = scope.inlined {
- result.insert(inlined.def_id());
+ let body = tcx.instance_mir(instance.def);
+ for block in body.basic_blocks.iter() {
+ for statement in &block.statements {
+ let mir::StatementKind::Coverage(_) = statement.kind else { continue };
+ let scope = statement.source_info.scope;
+ if let Some(inlined) = scope.inlined_instance(&body.source_scopes) {
+ result.insert(inlined.def_id());
+ }