Skip to content

rustc_arena::coldpath shouldn't be pub #81429

Closed

Description

@fogti

#[inline(never)]
#[cold]
pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {
f()
}

The function isn't used anywhere outside of that crate (there is a copy of that function in rustc_datastructures, which is used elsewhere). It shouldn't be pub at all because it is only used in the same file in which it is defined.

Activity

  1. added
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 27, 2021
  2. homersimpsons commented on Jan 27, 2021

    @homersimpsons
    Contributor

    Should not we use rustc_datastructures::cold_path instead of duplicating the function ?

  3. fogti commented on Jan 27, 2021

    @fogti
    ContributorAuthor

    rustc_arena currently doesn't depend on rustc_datastructures, and it would be a really heavyweight dependency. I don't think that's worth it as the function is extremely trivial.

  4. henryboisdequin commented on Jan 29, 2021

    @henryboisdequin
    Contributor

    @rustbot claim

  5. added a commit that references this issue on Jan 30, 2021
    ba40cea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions