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-rustdoc links: Consider supporting Self #49583

Closed
crumblingstatue opened this issue Apr 2, 2018 · 0 comments
Closed

intra-rustdoc links: Consider supporting Self #49583

crumblingstatue opened this issue Apr 2, 2018 · 0 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@crumblingstatue
Copy link
Contributor

Self is commonly used to avoid having to repeat the same type name over and over again. This makes renaming the type in the future, etc. easier, and DRY code is generally desirable.

Currently, the following produces a link with the literal text self::new instead of a correct link:

/// Use [`new`] to create a new instance.
///
/// [`new`]: Self::new
pub struct Foo;

impl Foo {
	/// Creates a new instance.
	pub fn new() -> Self {
		unimplemented!()
	}
}

Ref #43466

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 2, 2018
@XAMPPRocky XAMPPRocky added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 29, 2018
bors added a commit that referenced this issue Jul 22, 2018
…re-documented, r=QuietMisdreavus

Add "self" intra-link support

Fixes #49583.

r? @QuietMisdreavus
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants