{"record":{"id":"ca0973f23cc1c3b7","repo":"rust-lang/rust","slug":"argument-names-not-encoded-for-a-function","errorCode":null,"errorMessage":"argument names not encoded for a function","messagePattern":"argument names not encoded for a function","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"compiler/rustc_metadata/src/rmeta/decoder.rs","lineNumber":1380,"sourceCode":"            let children = self.root.tables.ambig_module_children.get(self, id);\n            if !children.is_default() {\n                for child in children.decode((self, tcx)) {\n                    yield child;\n                }\n            }\n        }\n    }\n\n    fn is_item_mir_available(&self, id: DefIndex) -> bool {\n        self.root.tables.optimized_mir.get(self, id).is_some()\n    }\n\n    fn get_fn_has_self_parameter(&self, tcx: TyCtxt<'_>, id: DefIndex) -> bool {\n        self.root\n            .tables\n            .fn_arg_idents\n            .get(self, id)\n            .expect(\"argument names not encoded for a function\")\n            .decode((self, tcx))\n            .nth(0)\n            .is_some_and(|ident| matches!(ident, Some(Ident { name: kw::SelfLower, .. })))\n    }\n\n    fn get_associated_item_or_field_def_ids(\n        &self,\n        tcx: TyCtxt<'_>,\n        id: DefIndex,\n    ) -> impl Iterator<Item = DefId> {\n        self.root\n            .tables\n            .associated_item_or_field_def_ids\n            .get(self, id)\n            .unwrap_or_else(|| self.missing(\"associated_item_or_field_def_ids\", id))\n            .decode((self, tcx))\n            .map(move |child_index| self.local_def_id(child_index))\n    }","sourceCodeStart":1362,"sourceCodeEnd":1398,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_metadata/src/rmeta/decoder.rs#L1362-L1398","documentation":"Fires in `get_fn_has_self_parameter` (decoder.rs:1380). The function looks up the `fn_arg_idents` table for a `DefIndex` and `.expect()`s an entry, because a function is assumed to have its argument names encoded. A missing entry means a non-function `DefIndex` was queried through this path, or the function's argument names were never serialized.","triggerScenarios":"Querying `fn_has_self_parameter` on a `DefIndex` that is not a function (e.g. a const, static, or type alias routed here by a stale query cache); reading a function whose metadata was written without `fn_arg_idents` (older encoder, or an extern/imported fn without encoded args).","commonSituations":"Cross-version artifact reuse where the encoder stopped/started writing `fn_arg_idents`; incremental cache referencing a renumbered `DefIndex`; querying self-ness of a function from a proc-macro or older rlib.","solutions":["`cargo clean` and rebuild to regenerate `fn_arg_idents` for the current schema.","Ensure the crate providing the function and the crate querying it share one toolchain version.","If the function is from a prebuilt dependency, rebuild it with the active compiler instead of reusing the old rlib.","Reproduces on a clean single-toolchain build -> file an ICE; the query was likely routed to a non-function `DefIndex`."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Regenerate function-arg metadata for the current schema\ncargo clean\ncargo build","typeGuard":null,"tryCatchPattern":"cargo build || { cargo clean && cargo build; }","preventionTips":["Rebuild dependencies with the active compiler; do not reuse rlibs from another rustc.","`cargo clean` after toolchain updates.","Pin toolchain versions across the build graph."],"tags":["metadata","rmeta","decoder","functions","ice"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}