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

[code coverage] Fix missing dead code in modules that are never called #92142

Merged
merged 4 commits into from
Jan 14, 2022

Commits on Dec 20, 2021

  1. Configuration menu
    Copy the full SHA
    341d65d View commit details
    Browse the repository at this point in the history
  2. [code coverage] Fix missing dead code in modules that are never called

    The issue here is that the logic used to determine which CGU to put the
    dead function stubs in doesn't handle cases where a module is never
    assigned to a CGU.
    
    The partitioning logic also caused issues in rust-lang#85461 where inline
    functions were duplicated into multiple CGUs resulting in duplicate
    symbols.
    
    This commit fixes the issue by removing the complex logic used to assign
    dead code stubs to CGUs and replaces it with a much simplier model: we
    pick one CGU to hold all the dead code stubs. We pick a CGU which has
    exported items which increases the likelihood the linker won't throw
    away our dead functions and we pick the smallest to minimize the impact
    on compilation times for crates with very large CGUs.
    
    Fixes rust-lang#86177
    Fixes rust-lang#85718
    Fixes rust-lang#79622
    wesleywiser committed Dec 20, 2021
    Configuration menu
    Copy the full SHA
    ef57f24 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2021

  1. Address review comments

    wesleywiser committed Dec 27, 2021
    Configuration menu
    Copy the full SHA
    ebc0d0d View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2022

  1. Ignore unused_mod.rs file in code coverage results

    As discussed in
    rust-lang#92142 (comment),
    tests that contain multiple files order their results differently on
    Windows and Linux which the test runner currently can't handle
    correctly. For now, ignore the "bin" part of the test and only include
    the unused library dependency which is what the test really cares about
    anyway.
    wesleywiser committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    e9cac4c View commit details
    Browse the repository at this point in the history