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

Rustdoc should show [src] link for methods #12932

Closed
huonw opened this issue Mar 16, 2014 · 6 comments · Fixed by #43509
Closed

Rustdoc should show [src] link for methods #12932

huonw opened this issue Mar 16, 2014 · 6 comments · Fixed by #43509
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Mar 16, 2014

Test case:

#[crate_id="foo"];
pub struct Foo;

impl Foo {
    #[unstable] pub fn foo(&self) {}
}
lifthrasiir added a commit to lifthrasiir/rust that referenced this issue Apr 27, 2014
…ng#12932.

this change made most functions that render the methods to require
the render `Context`, so they are now made into `Context` methods.
adrientetar pushed a commit to adrientetar/rust that referenced this issue May 8, 2014
…ng#12932.

this change made most functions that render the methods to require
the render `Context`, so they are now made into `Context` methods.

Conflicts:
	src/librustdoc/html/markdown.rs
	src/librustdoc/html/render.rs
	src/librustdoc/html/static/main.css

Conflicts:
	src/librustdoc/html/render.rs
@emberian
Copy link
Member

Stability is fixed now, just needs [src] links.

@emberian emberian changed the title Rustdoc should show stability & [src] link for methods Rustdoc should show [src] link for methods Jul 29, 2014
@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Feb 11, 2015
@steveklabnik
Copy link
Member

Triage: no src link on methods as of today.

@birkenfeld
Copy link
Contributor

We have [src] for impls now. Is that enough?

@SimonSapin
Copy link
Contributor

@birkenfeld Did this just land? I can’t find these links in https://doc.rust-lang.org/std/ Is it only trait impls on inherent as well?

In any case it’s an improvement, but some impl blocks are very large and source links on individual methods would still be useful in my opinion.

@birkenfeld
Copy link
Contributor

@SimonSapin yep, it was merged recently: #33382 and works for both kinds of impls. It should be visible in the nightly docs already. There appear to be some problems with linking to impls pulled from core to std, I planned to investigate if that's fixable later.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@QuietMisdreavus
Copy link
Member

I've opened #43509 to fix this.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Jul 29, 2017
…aumeGomez

rustdoc: add [src] links to associated functions inside an impl block

While impl blocks currently have a `[src]` link to show the source for the impl block as a whole, individual methods inside that impl block do not. This can pose a problem for structs with a lot of methods, like many in libstd. This change adds little `[src]` links to individual methods that point directly to the function in the bundled source.

fixes rust-lang#12932

![methods on HashMap, showing the new src links](https://user-images.githubusercontent.com/5217170/28686066-9e7a19de-72cf-11e7-8e6b-b7d60fa33032.png)
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 30, 2017
…aumeGomez

rustdoc: add [src] links to associated functions inside an impl block

While impl blocks currently have a `[src]` link to show the source for the impl block as a whole, individual methods inside that impl block do not. This can pose a problem for structs with a lot of methods, like many in libstd. This change adds little `[src]` links to individual methods that point directly to the function in the bundled source.

fixes rust-lang#12932

![methods on HashMap, showing the new src links](https://user-images.githubusercontent.com/5217170/28686066-9e7a19de-72cf-11e7-8e6b-b7d60fa33032.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
6 participants