Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reachable coverage without counters #99711

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Commits on Jul 25, 2022

  1. Remove reachable coverage without counters

    Remove reachable coverage without counters to maintain invariant that
    either there is no coverage at all or there is a live coverage counter
    left that provides the function source hash.
    
    The motivating example would be a following closure:
    
    ```rust
        let f = |x: bool| {
            debug_assert!(x);
        };
    ```
    
    Which, with span changes from rust-lang#93967, with disabled debug assertions,
    after the final CFG simplifications but before removal of dead blocks,
    gives rise to MIR:
    
    ```rust
    fn main::{closure#0}(_1: &[[email protected]:2:13: 2:22], _2: bool) -> () {
        debug x => _2;
        let mut _0: ();
    
        bb0: {
            Coverage::Expression(4294967295) = 1 - 2;
            return;
        }
    
        ...
    }
    ```
    tmiasko committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    5f40a4f View commit details
    Browse the repository at this point in the history