Repository: rust
Issue: "not in index or paths" when using intra-doc link on primitive integer method
Labels: T-rustdoc,A-rustdoc-json

This was a test failure in #122520, specifically from https://github.com/rust-lang/rust/commit/234e383c3426281447da140e24ccf6bf5402f6f5#diff-dd440fe33121a785308d5cde98a1ab79b0b285d27bb29eaa9800e180870e16a6R507

I have no idea what's wrong with it, since the link works fine in the normal `x doc` build.

```text
2024-03-15T02:48:47.0135086Z ##[group]Testing stage2 compiletest suite=rustdoc-json mode=rustdoc-json (x86_64-unknown-linux-gnu)
2024-03-15T02:48:47.1162480Z 
2024-03-15T02:48:47.1163264Z running 122 tests
2024-03-15T02:48:52.8971769Z ..................................................................
2024-03-15T02:48:52.8973256Z [rustdoc-json] tests/rustdoc-json/primitives/primitive_overloading.rs ... F
2024-03-15T02:48:53.3616358Z 
2024-03-15T02:48:53.3617555Z [rustdoc-json] tests/rustdoc-json/primitives/use_primitive.rs ... F
2024-03-15T02:48:55.3326430Z ....................  88/122
2024-03-15T02:48:57.4939882Z ..................................
2024-03-15T02:48:57.4940377Z 
2024-03-15T02:48:57.4941606Z failures:
2024-03-15T02:48:57.4941839Z 
2024-03-15T02:48:57.4942579Z ---- [rustdoc-json] tests/rustdoc-json/primitives/primitive_overloading.rs stdout ----
2024-03-15T02:48:57.4943251Z 
2024-03-15T02:48:57.4943699Z error: jsondoclint failed!
2024-03-15T02:48:57.4944115Z status: exit status: 1
2024-03-15T02:48:57.4945562Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-json/primitives/primitive_overloading/primitive_overloading.json"
2024-03-15T02:48:57.4946954Z stdout: none
2024-03-15T02:48:57.4947278Z --- stderr -------------------------------
2024-03-15T02:48:57.4948453Z 2:8856:44107 not in index or paths, but referred to at '$.index["2:29738:1803"].links["Option::unwrap_unchecked"]' and 2 more
2024-03-15T02:48:57.4950448Z Error: Errors validating json /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-json/primitives/primitive_overloading/primitive_overloading.json
2024-03-15T02:48:57.4951533Z Build completed unsuccessfully in 0:35:04
2024-03-15T02:48:57.4952067Z ------------------------------------------
2024-03-15T02:48:57.4952340Z 
2024-03-15T02:48:57.4952347Z 
2024-03-15T02:48:57.4952737Z ---- [rustdoc-json] tests/rustdoc-json/primitives/use_primitive.rs stdout ----
2024-03-15T02:48:57.4953193Z 
2024-03-15T02:48:57.4953346Z error: jsondoclint failed!
2024-03-15T02:48:57.4953633Z status: exit status: 1
2024-03-15T02:48:57.4954729Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-json/primitives/use_primitive/use_primitive.json"
2024-03-15T02:48:57.4955725Z stdout: none
2024-03-15T02:48:57.4956015Z --- stderr -------------------------------
2024-03-15T02:48:57.4956831Z 2:8856:44106 not in index or paths, but referred to at '$.index["2:29738:1803"].links["Option::unwrap_unchecked"]' and 2 more
2024-03-15T02:48:57.4958019Z Error: Errors validating json /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-json/primitives/use_primitive/use_primitive.json
2024-03-15T02:48:57.4958916Z ------------------------------------------
2024-03-15T02:48:57.4959144Z 
2024-03-15T02:48:57.4959150Z 
2024-03-15T02:48:57.4959155Z 
2024-03-15T02:48:57.4959248Z failures:
2024-03-15T02:48:57.4959676Z     [rustdoc-json] tests/rustdoc-json/primitives/primitive_overloading.rs
2024-03-15T02:48:57.4960292Z     [rustdoc-json] tests/rustdoc-json/primitives/use_primitive.rs
2024-03-15T02:48:57.4960624Z 
2024-03-15T02:48:57.4960978Z test result: FAILED. 120 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 10.38s
2024-03-15T02:48:57.4961463Z 
2024-03-15T02:48:57.4962060Z Some tests failed in compiletest suite=rustdoc-json mode=rustdoc-json host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
```

See also <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/rustdoc-json.20test.20help/near/426682489>