rust/compiler/rustc_mir/src
Yuki Okushi 343a094aa1
Rollup merge of #84897 - richkadel:cover-closure-macros, r=tmandry
Coverage instruments closure bodies in macros (not the macro body)

Fixes: #84884

This solution might be considered a compromise, but I think it is the
better choice.

The results in the `closure.rs` test correctly resolve all test cases
broken as described in #84884.

One test pattern (in both `closure_macro.rs` and
`closure_macro_async.rs`) was also affected, and removes coverage
statistics for the lines inside the closure, because the closure
includes a macro. (The coverage remains at the callsite of the macro, so
we lose some detail, but there isn't a perfect choice with macros.

Often macro implementations are split across the macro and the callsite,
and there doesn't appear to be a single "right choice" for which body
should be covered. For the current implementation, we can't do both.

The callsite is most likely to be the preferred site for coverage.

r? `@tmandry`
cc: `@wesleywiser`
2021-05-07 15:20:26 +09:00
..
borrow_check add docstrings and add issue to FIXMEs 2021-05-01 19:01:06 -04:00
const_eval remove now-unused 'is_min_const_fn' 2021-04-25 12:54:34 +02:00
dataflow fix few typos 2021-04-19 15:57:08 +03:00
interpret CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs 2021-05-04 13:56:31 +02:00
monomorphize Implement RFC 1260 with feature_name imported_main. 2021-04-29 08:35:08 +08:00
transform Coverage instruments closure bodies in macros (not the macro body) 2021-05-06 11:15:39 -07:00
util spanview debug output caused ICE when a function had no body 2021-04-28 20:27:27 -07:00
lib.rs fix feature use in rustc libs 2021-04-18 22:05:45 +02:00
shim.rs Prepare mir::Constant for ty::Const only supporting valtrees 2021-03-12 12:43:54 +00:00