about summary refs log tree commit diff
path: root/tests/coverage/macro_name_span.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-11-12 18:07:28 +1100
committerZalathar <Zalathar@users.noreply.github.com>2023-11-12 18:33:11 +1100
commited8298b825b8c2c5b57471cdd13dec9f94e26c03 (patch)
treef1687edeaf1dc32b7914e93c6e3aa7a0e3914ee8 /tests/coverage/macro_name_span.rs
parenta04d56b36d8f634abd7bdd64dd859a30655f1818 (diff)
downloadrust-ed8298b825b8c2c5b57471cdd13dec9f94e26c03.tar.gz
rust-ed8298b825b8c2c5b57471cdd13dec9f94e26c03.zip
coverage: Avoid creating malformed macro name spans
This method is trying to detect macro invocations, so that it can split a span
into two parts just after the `!` of the invocation.

Under some circumstances (probably involving nested macros), it gets confused
and produces a span that is larger than the original span, and possibly extends
outside its enclosing function and even into an adjacent file.

In extreme cases, that can result in malformed coverage mappings that cause
`llvm-cov` to fail. For now, we at least want to detect these egregious cases
and avoid them, so that coverage reports can still be produced.
Diffstat (limited to 'tests/coverage/macro_name_span.rs')
0 files changed, 0 insertions, 0 deletions