{"record":{"id":"7f6ba3fb572290ec","repo":"rust-lang/rust","slug":"unrecognized-type-identifier-ty-name","errorCode":null,"errorMessage":"unrecognized type identifier `{ty_name}`","messagePattern":"unrecognized type identifier `(.+?)`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"library/compiler-builtins/crates/libm-macros/src/lib.rs","lineNumber":268,"sourceCode":"            continue;\n        }\n\n        // Run everything else\n        fn_list.push(func);\n    }\n\n    // Types that the user would like us to provide in the macro\n    let mut add_all_types = false;\n    for ty in &input.emit_types {\n        let ty_name = ty.to_string();\n        if ty_name == \"all\" {\n            add_all_types = true;\n            continue;\n        }\n\n        // Check that all requested types are valid\n        if !KNOWN_TYPES.contains(&ty_name.as_str()) {\n            let e = syn::Error::new(\n                ty_name.span(),\n                format!(\"unrecognized type identifier `{ty_name}`\"),\n            );\n            return Err(e);\n        }\n    }\n\n    if add_all_types {\n        // Ensure that if `all` was specified that nothing else was\n        if input.emit_types.len() > 1 {\n            let e = syn::Error::new(\n                input.emit_types_span.unwrap(),\n                \"if `all` is specified, no other type identifiers may be given\",\n            );\n            return Err(e);\n        }\n\n        // ...and then add all types","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/library/compiler-builtins/crates/libm-macros/src/lib.rs#L250-L286","documentation":"The `for_each_function!` macro's `emit_types` field selects which type metadata to pass to the callback. Only identifiers in KNOWN_TYPES (CFn, CArgs, CRet, RustFn, RustArgs, RustRet, path) or the keyword `all` are accepted (lib.rs:13-15). During validate(), each entry is checked against that set; an entry matching none triggers this error.","triggerScenarios":"Supplying `emit_types: [RustSig]`, `emit_types: [FooType]`, or any list containing an identifier not in {CFn, CArgs, CRet, RustFn, RustArgs, RustRet, path, all}.","commonSituations":"Typoing a known type name (e.g. `RustFnction`), inventing a type identifier that does not exist, or migrating from an older version of the macro that used different names.","solutions":["Replace the invalid identifier with one of CFn, CArgs, CRet, RustFn, RustArgs, RustRet, or path.","If every type is needed, use emit_types: all instead of listing names.","Cross-check the spelling against the KNOWN_TYPES list in lib.rs:13."],"exampleFix":"// before\nlibm_macros::for_each_function! {\n    callback: cb,\n    emit_types: [RustSignature],\n}\n// after\nlibm_macros::for_each_function! {\n    callback: cb,\n    emit_types: [RustFn, RustArgs, RustRet],\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the allowed set (CFn, CArgs, CRet, RustFn, RustArgs, RustRet, path, all) visible when editing emit_types.","Run a cargo check after any change to a for_each_function! invocation."],"tags":["rust","proc-macro","libm","compile-time","validation"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}