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

rustc_arena::coldpath shouldn't be pub #81429

Closed
fogti opened this issue Jan 27, 2021 · 3 comments · Fixed by #81505
Closed

rustc_arena::coldpath shouldn't be pub #81429

fogti opened this issue Jan 27, 2021 · 3 comments · Fixed by #81505
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fogti
Copy link
Contributor

fogti commented Jan 27, 2021

#[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.

@jonas-schievink jonas-schievink added C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 27, 2021
@homersimpsons
Copy link
Contributor

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

@fogti
Copy link
Contributor Author

fogti commented Jan 27, 2021

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.

@henryboisdequin
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants