Skip to content

intra-rustdoc links: Consider supporting Self #49583

Closed
@crumblingstatue

Description

@crumblingstatue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions