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 MonoItems. #112126

Closed
wants to merge 1 commit into from
Closed

Commits on May 31, 2023

  1. Remove MonoItems.

    PR rust-lang#97168 was created to address this comment in `record_accesses`:
    
    // We collect this into a `SmallVec` to avoid calling `is_inlining_candidate` in the lock.
    // FIXME: Call `is_inlining_candidate` when pushing to `neighbors` in `collect_items_rec`
    // instead to avoid creating this `SmallVec`.
    
    It removed the need for the `SmallVec` (a good thing) by introducing
    `MonoItems`, which introduced some additional complexity (a bad thing).
    
    However, the reason the `SmallVec` was being used in the first place --
    "to avoid calling `is_inlining_candidate` in the lock" -- isn't
    necessary, as far as I can tell. Perhaps it was at one point.
    
    So this commit just moves what is left of the call to
    `is_inlining_candidate` -- a call the innocuous `instantiation_mode` --
    inside the lock. This avoids the complexity of `MonoItems` sometimes
    computing inlining data and sometimes not.
    nnethercote committed May 31, 2023
    Configuration menu
    Copy the full SHA
    6d7674b View commit details
    Browse the repository at this point in the history