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

Intra-doc links should work for deref methods #75643

Closed
jyn514 opened this issue Aug 17, 2020 · 8 comments
Closed

Intra-doc links should work for deref methods #75643

jyn514 opened this issue Aug 17, 2020 · 8 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-feature-request Category: A feature request, i.e: not implemented / a PR. I-needs-decision Issue: In need of a decision. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Aug 17, 2020

I tried this code:

/// [`get`]: std::vec::Vec::get
pub fn f() {}

I expected to see this happen: A link to https://doc.rust-lang.org/std/vec/struct.Vec.html#method.get

Instead, this happened: The link wasn't resolved, because get is a method on slices, not Vec itself.

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Aug 17, 2020
@jyn514
Copy link
Member Author

jyn514 commented Aug 17, 2020

Note that this currently means Vec::get can't be linked to at all because of #63351.

@GuillaumeGomez
Copy link
Member

I need to get back to the fix and understand what changes between the two.

@jyn514
Copy link
Member Author

jyn514 commented Aug 18, 2020

FWIW I don't think this ever worked, it just wasn't implemented.

@GuillaumeGomez
Copy link
Member

It never did, I was referring to my PR to fix primitive discoverability.

@Manishearth
Copy link
Member

I'm against this, Vec::get does not exist and does not work in code. I think we should maybe just bite the bullet and allow slice to exist as a string.

@jyn514
Copy link
Member Author

jyn514 commented Aug 20, 2020

I'm ok with saying we should fix linking to primitives instead, but it's not as simple as 'allow slice to exist as a string', see #63351 (comment).

cuviper added a commit to cuviper/rust that referenced this issue Aug 20, 2020
Move to intra-doc links for task.rs and vec.rs

Partial fix for rust-lang#75080

links for [`get`], [`get_mut`] skipped due to rust-lang#75643
link for [`copy_from_slice`] skipped due to rust-lang#63351
@jyn514 jyn514 added the I-needs-decision Issue: In need of a decision. label Aug 22, 2020
@camelid
Copy link
Member

camelid commented Nov 8, 2021

I'm against this, Vec::get does not exist and does not work in code. I think we should maybe just bite the bullet and allow slice to exist as a string.

I'm ok with saying we should fix linking to primitives instead, but it's not as simple as 'allow slice to exist as a string', see #63351 (comment).

slice::get works now, so should this issue be closed?

@jyn514
Copy link
Member Author

jyn514 commented Nov 8, 2021

Yeah, that seems reasonable.

@jyn514 jyn514 closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-feature-request Category: A feature request, i.e: not implemented / a PR. I-needs-decision Issue: In need of a decision. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants