Skip to content

Fix jump to def link generation on primitive type associated methods#156736

Open
GuillaumeGomez wants to merge 1 commit into
rust-lang:mainfrom
GuillaumeGomez:primitive-assoc-methods
Open

Fix jump to def link generation on primitive type associated methods#156736
GuillaumeGomez wants to merge 1 commit into
rust-lang:mainfrom
GuillaumeGomez:primitive-assoc-methods

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

@GuillaumeGomez GuillaumeGomez commented May 19, 2026

Fixes #156707.

Interestingly enough, the inference fails on primitive type, so instead I go around a bit by generating a PrimitiveType and then tweak a bit the href generation.

r? @fmease

@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 May 19, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt check
Diff in /checkout/src/librustdoc/html/format.rs:459:
     }
 
     let (fqp, shortty): (Vec<Symbol>, ItemType) = match prim {
-        Some(prim) => {
-            (vec![crate_name, prim.as_sym()], ItemType::Primitive)
-        }
+        Some(prim) => (vec![crate_name, prim.as_sym()], ItemType::Primitive),
         None => {
             let relative = clean::inline::item_relative_path(tcx, def_id);
             (once(crate_name).chain(relative).collect(), ItemType::from_def_id(def_id, tcx))
fmt: checked 6864 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:00:49
  local time: Tue May 19 02:09:27 UTC 2026
  network time: Tue, 19 May 2026 02:09:27 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc generates broken link for inherent methods on primitive types on source code pages under --generate-link-to-definition

4 participants