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

Self on its own does not resolve in intra-doc links #77732

Closed
jyn514 opened this issue Oct 9, 2020 · 1 comment · Fixed by #80881
Closed

Self on its own does not resolve in intra-doc links #77732

jyn514 opened this issue Oct 9, 2020 · 1 comment · Fixed by #80881
Assignees
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Oct 9, 2020

I tried this code:

/// [Self]
pub struct S { u: usize }

I expected to see this happen: The link behaves the same as struct@S

Instead, this happened: Rustdoc says the link failed to resolve:

warning: unresolved link to `Self`
 --> s.rs:1:6
  |
1 | /// [Self]
  |      ^^^^ the module `s` contains no item named `Self`

Note that Self::u resolves fine.

Meta

rustdoc --version:

rustdoc 1.48.0-nightly (ef663a8a4 2020-09-30)
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Oct 9, 2020
@jyn514 jyn514 self-assigned this Oct 9, 2020
jyn514 added a commit to jyn514/rust that referenced this issue Oct 9, 2020
this breaks because it still goes through
`resolve_with_disambiguator()`; it should skip that logic altogether
@jyn514
Copy link
Member Author

jyn514 commented Jan 10, 2021

crate too (I think since #76467). crate doesn't fail to resolve, it's just wrong across crates (see the hack in #77253).

@bors bors closed this as completed in 6e2249d Jan 11, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 2, 2021
Update intra-doc link documentation to match the implementation

r? `@Manishearth`
cc `@camelid` `@m-ou-se`

Relevant PRs:
- rust-lang#74489
- rust-lang#80181
- rust-lang#76078
- rust-lang#77519
- rust-lang#73101

Relevant issues:
- rust-lang#78800
- rust-lang#77200
- rust-lang#77199 / rust-lang#54191

I haven't documented things that I consider 'just bugs', like rust-lang#77732, but I have documented features that aren't implemented, like rust-lang#78800.
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-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant