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

Comments

Projects
None yet
6 participants
@huonw
Copy link
Member

huonw commented Mar 16, 2014

Test case:

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

impl Foo {
    #[unstable] pub fn foo(&self) {}
}

@huonw huonw added the A-rustdoc label Mar 16, 2014

lifthrasiir added a commit to lifthrasiir/rust that referenced this issue Apr 27, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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 added a commit to adrientetar/rust that referenced this issue May 7, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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

adrientetar added a commit to adrientetar/rust that referenced this issue May 7, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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

adrientetar added a commit to adrientetar/rust that referenced this issue May 7, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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

adrientetar added a commit to adrientetar/rust that referenced this issue May 8, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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

adrientetar added a commit to adrientetar/rust that referenced this issue May 8, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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

adrientetar added a commit to adrientetar/rust that referenced this issue May 8, 2014

rustdoc: Add stability and source links to the methods. Fixes rust-la…
…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
@cmr

This comment has been minimized.

Copy link
Member

cmr commented Jul 29, 2014

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

@cmr cmr changed the title Rustdoc should show stability & [src] link for methods Rustdoc should show [src] link for methods Jul 29, 2014

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Mar 4, 2016

Triage: no src link on methods as of today.

@birkenfeld

This comment has been minimized.

Copy link
Contributor

birkenfeld commented May 9, 2016

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

@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented May 9, 2016

@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

This comment has been minimized.

Copy link
Contributor

birkenfeld commented May 9, 2016

@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.

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Jul 27, 2017

I've opened #43509 to fix this.

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

Rollup merge of rust-lang#43509 - QuietMisdreavus:method-src, r=Guill…
…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

Rollup merge of rust-lang#43509 - QuietMisdreavus:method-src, r=Guill…
…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)

@bors bors closed this in #43509 Jul 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.