is_coroutine -> is_coroutine_or_closure
This commit is contained in:
parent
d59f06fc64
commit
07adee7072
15 changed files with 29 additions and 22 deletions
|
@ -345,7 +345,7 @@ fn get_body_span<'tcx>(
|
|||
) -> Span {
|
||||
let mut body_span = hir_body.value.span;
|
||||
|
||||
if tcx.is_closure(def_id.to_def_id()) {
|
||||
if tcx.is_closure_or_coroutine(def_id.to_def_id()) {
|
||||
// If the current function is a closure, and its "body" span was created
|
||||
// by macro expansion or compiler desugaring, try to walk backwards to
|
||||
// the pre-expansion call site or body.
|
||||
|
|
|
@ -74,7 +74,7 @@ fn bcb_to_initial_coverage_spans<'a, 'tcx>(
|
|||
let expn_span = filtered_statement_span(statement)?;
|
||||
let span = unexpand_into_body_span(expn_span, body_span)?;
|
||||
|
||||
Some(CoverageSpan::new(span, expn_span, bcb, is_closure(statement)))
|
||||
Some(CoverageSpan::new(span, expn_span, bcb, is_closure_or_coroutine(statement)))
|
||||
});
|
||||
|
||||
let terminator_span = Some(data.terminator()).into_iter().filter_map(move |terminator| {
|
||||
|
@ -88,7 +88,7 @@ fn bcb_to_initial_coverage_spans<'a, 'tcx>(
|
|||
})
|
||||
}
|
||||
|
||||
fn is_closure(statement: &Statement<'_>) -> bool {
|
||||
fn is_closure_or_coroutine(statement: &Statement<'_>) -> bool {
|
||||
match statement.kind {
|
||||
StatementKind::Assign(box (_, Rvalue::Aggregate(box ref agg_kind, _))) => match agg_kind {
|
||||
AggregateKind::Closure(_, _) | AggregateKind::Coroutine(_, _) => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue