Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Sep 25, 2025

Fixes #146855.

Alternative to #146866.

This adds support for a new disambiguator: tyalias. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc @fmease
r? lolbinarycat

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 25, 2025
@GuillaumeGomez GuillaumeGomez changed the title Add new tyalias intra-doc link disambiguator Add new tyalias intra-doc link disambiguator Sep 25, 2025
Copy link
Contributor

@lolbinarycat lolbinarycat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised adding a new disambiguator is so simple, just a few suggestions.

View changes since this review

"value" => NS(Namespace::ValueNS),
"macro" => NS(Namespace::MacroNS),
"prim" | "primitive" => Primitive,
"tyalias" => Kind(DefKind::TyAlias),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also accept typealias, similar to how constant and primitive are accepted as alternate long forms.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

Comment on lines +11 to +15
/// This function returns [`f32`].
//~^ ERROR: `f32` is both a type alias and a primitive type
//~| HELP: to link to the type alias, prefix with `tyalias@`
//~| HELP: to link to the primitive type, prefix with `prim@`
pub fn my_fn() -> f32 {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we link to type@f32? It would be nice to also check that case.

Comment on lines 4 to 6
#![crate_name = "foo"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#![crate_name = "foo"]
#![crate_name = "foo"]
#![deny(rustdoc::broken_intra_doc_links)]

the rustdoc gui suite is not run with -Dwarnings.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 25, 2025
@GuillaumeGomez
Copy link
Member Author

Applied suggestions.

@GuillaumeGomez
Copy link
Member Author

@bors r=lolbinarycat rollup

@bors
Copy link
Collaborator

bors commented Sep 25, 2025

📌 Commit 5c710d7 has been approved by lolbinarycat

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 25, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 8 pull requests

Successful merges:

 - #146283 (Resolve: (Ref)Cell wrappers to deny mutation during spec resolution.)
 - #146453 (Add general arm-linux.md platform doc.)
 - #146991 (const_caller_location to use real Span instead of `DUMMY_SP`)
 - #146994 (Add `clippy::unconditional_recursion` to `./x clippy ci`)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147038 (Rename verbosity functions in bootstrap)
 - #147047 (rustdoc: put the toolbar on the all item index)
 - #147049 (std: fix warning in VEXos stdio module)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors r-
#147053 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@GuillaumeGomez
Copy link
Member Author

@matthiaskrgr Tested locally and then rebased and re-tested locally, no issue. Not sure it was coming from this PR but maybe a mix with another.

@bors r=lolbinarycat rollup

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit f675271 has been approved by lolbinarycat

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 26, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 7 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146778 (Use standard attribute logic for allocator shim)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

still failing
#147059 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 26, 2025
@GuillaumeGomez
Copy link
Member Author

Ah, I think it's a channel issue.

@GuillaumeGomez
Copy link
Member Author

It was indeed a channel issue. ^^'

@bors r=lolbinarycat rollup

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit 62c457b has been approved by lolbinarycat

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 26, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 27, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 67d88f9 into rust-lang:master Sep 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 27, 2025
rust-timer added a commit that referenced this pull request Sep 27, 2025
Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes #146855.

Alternative to #146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
@GuillaumeGomez GuillaumeGomez deleted the tyalias-disambiguator branch September 27, 2025 09:34
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 29, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145113 (resolve: Do not finalize shadowed bindings)
 - rust-lang/rust#146523 (Demote both armebv7r-none-* targets.)
 - rust-lang/rust#146704 (port `#[debugger_visualizer]` to the new attribute system)
 - rust-lang/rust#146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - rust-lang/rust#146778 (Use standard attribute logic for allocator shim)
 - rust-lang/rust#146849 (Reduce some uses of `LegacyBang`)
 - rust-lang/rust#147016 (fix doc comments to be more standard)
 - rust-lang/rust#147027 (Add new `tyalias` intra-doc link disambiguator)
 - rust-lang/rust#147031 (mbe: Simplify check_redundant_vis_repetition)
 - rust-lang/rust#147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc intra-doc link: cannot disambiguate between primitive and type alias
5 participants