rust/compiler/rustc_mir/src
bors 1c2c6b6700 Auto merge of #84582 - richkadel:issue-84561, r=tmandry
Vastly improves coverage spans for macros

Fixes: #84561

This resolves problems where macros like `trace!(...)` would show zero coverage if tracing was disabled, and `assert_eq!(...)` would show zero coverage if the assertion did not fail, because only one coverage span was generated, for the branch.

This PR started with an idea that I could just drop branching blocks with same span as expanded macro. (See the fixed issue for more details.)

That did help, but it didn't resolve everything.

I also needed to add a span specifically for the macro name (plus `!`) to ensure the macro gets coverage even if it's internal expansion adds conditional branching blocks that are retained, and would otherwise drop the outer span. Now that outer span is _only_ the `(argument, list)`, which can safely be dropped now), because the macro name has its own span.

While testing, I also noticed the spanview debug output can cause an ICE on a function with no body. The
workaround for this is included in this PR (separate commit).

r? `@tmandry`
cc? `@wesleywiser`
2021-05-01 07:48:24 +00:00
..
borrow_check Remove extra word in rustc_mir docs 2021-04-28 09:53:32 -07: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 fix few typos 2021-04-19 15:57:08 +03:00
monomorphize Implement RFC 1260 with feature_name imported_main. 2021-04-29 08:35:08 +08:00
transform Auto merge of #84582 - richkadel:issue-84561, r=tmandry 2021-05-01 07:48:24 +00: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