{"record":{"id":"1c63776742d7bc50","repo":"rust-lang/rust","slug":"no-resolutions-for-a-doc-link","errorCode":null,"errorMessage":"no resolutions for a doc link","messagePattern":"no resolutions for a doc link","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_metadata/src/rmeta/decoder.rs","lineNumber":1924,"sourceCode":"                }\n            })\n            .clone()\n    }\n\n    fn get_attr_flags(&self, index: DefIndex) -> AttrFlags {\n        self.root.tables.attr_flags.get(self, index)\n    }\n\n    fn get_intrinsic(&self, tcx: TyCtxt<'_>, index: DefIndex) -> Option<ty::IntrinsicDef> {\n        self.root.tables.intrinsic.get(self, index).map(|d| d.decode((self, tcx)))\n    }\n\n    fn get_doc_link_resolutions(&self, tcx: TyCtxt<'_>, index: DefIndex) -> DocLinkResMap {\n        self.root\n            .tables\n            .doc_link_resolutions\n            .get(self, index)\n            .expect(\"no resolutions for a doc link\")\n            .decode((self, tcx))\n    }\n\n    fn get_doc_link_traits_in_scope(\n        &self,\n        tcx: TyCtxt<'_>,\n        index: DefIndex,\n    ) -> impl Iterator<Item = DefId> {\n        self.root\n            .tables\n            .doc_link_traits_in_scope\n            .get(self, index)\n            .expect(\"no traits in scope for a doc link\")\n            .decode((self, tcx))\n    }\n}\n\nimpl CrateMetadata {","sourceCodeStart":1906,"sourceCodeEnd":1942,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_metadata/src/rmeta/decoder.rs#L1906-L1942","documentation":"Fires in `get_doc_link_resolutions` (decoder.rs:1924). Rustdoc encodes, per definition, the resolution of intra-doc links so downstream doc builds can reuse them; the decoder `.expect()`s an entry in the `doc_link_resolutions` table. A missing entry means a definition was queried for doc-link resolutions that never had them encoded.","triggerScenarios":"Running `cargo doc` on a crate whose dependency was compiled without doc metadata (`--no-deps`, or built as a non-doc rlib) but is now being asked for doc-link resolutions; cross-version reuse where the doc-link table layout changed; querying resolutions for a definition that is not a doc-link target.","commonSituations":"Mixing `cargo build` artifacts with `cargo doc` runs in a shared `target/`; dependency built without `--cfg docsrs` / doc metadata; toolchain drift.","solutions":["`cargo clean` and run `cargo doc` from scratch so doc metadata is encoded consistently.","Build dependencies with doc metadata enabled (avoid `--no-deps` for the crates you document).","Align toolchain versions across the doc build graph.","Clean-build doc ICE -> file against rustdoc with the crate that triggers the link resolution query."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Ensure dependencies carry doc metadata before running cargo doc\ncargo clean\ncargo doc --document-private-items   # builds deps with doc metadata","typeGuard":null,"tryCatchPattern":"cargo doc || { cargo clean && cargo doc; }","preventionTips":["Do not share a `target/` between `cargo build` and `cargo doc` without cleaning.","Keep doc flags (`RUSTDOCFLAGS`) consistent across the doc build graph.","Avoid `--no-deps` for crates whose intra-doc links you need to resolve."],"tags":["metadata","rmeta","decoder","rustdoc","doc-links","ice"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}