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

[docs] core::global_allocator should link to std::alloc::GlobalAlloc #77100

Closed
yoshuawuyts opened this issue Sep 23, 2020 · 7 comments · Fixed by #77219
Closed

[docs] core::global_allocator should link to std::alloc::GlobalAlloc #77100

yoshuawuyts opened this issue Sep 23, 2020 · 7 comments · Fixed by #77219
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@yoshuawuyts
Copy link
Member

yoshuawuyts commented Sep 23, 2020

Seaching for global_allocator in the docs only surfaces core::global_allocator. This surfaces no information on how to use it, since all that info is part of std::alloc::GlobalAlloc.

The solution seems to link from global_allocator to GlobalAlloc so people can read more. However I'm not sure how to create a link between these since they live in separate crates. What's the right way to go about this?

edit: if someone wants to pick this up, please do. This is probably a "good first issue" once we figure out how to link between the two.

Screenshots

Screenshot_2020-09-23 core global_allocator - Rust

References

@yoshuawuyts yoshuawuyts changed the title [docs] core::global_allocator should link to std::alloc::GlobalAlloc [docs] core::global_allocator should link to std::alloc::GlobalAlloc Sep 23, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 23, 2020

The solution seems to link from global_allocator to GlobalAlloc so people can read more. However I'm not sure how to create a link between these since they live in separate crates. What's the right way to go about this?

These can't use intra-doc links, so you need to use relative links. I think ../std/alloc/trait.GlobalAlloc.html would work.

@jyn514 jyn514 added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Sep 23, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 23, 2020

Mentoring instructions: At

/// Attribute macro applied to a static to register it as a global allocator.

add a link to ../std/alloc/trait.GlobalAlloc.html.

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Sep 23, 2020
@mightyiam
Copy link
Contributor

Could I take this on as my first issue?

@yoshuawuyts
Copy link
Member Author

@mightyiam please do!

@LeSeulArtichaut
Copy link
Contributor

Feel free to use the @rustbot claim command to assign the issue to yourself and show you're working on it

@mightyiam
Copy link
Contributor

@rustbot claim

@yoshuawuyts
Copy link
Member Author

yay; thanks for landing this @mightyiam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API 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