{"record":{"id":"a6b5c8f4cc1eedc8","repo":"rust-lang/rust","slug":"if-all-is-specified-no-other-type-identifiers-m","errorCode":null,"errorMessage":"if `all` is specified, no other type identifiers may be given","messagePattern":"if `all` is specified, no other type identifiers may be given","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"library/compiler-builtins/crates/libm-macros/src/lib.rs","lineNumber":279,"sourceCode":"        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\n        input.emit_types.clear();\n        for ty in KNOWN_TYPES {\n            let ident = Ident::new(ty, Span::call_site());\n            input.emit_types.push(ident);\n        }\n    }\n\n    if let Some(map) = &input.fn_extra\n        && !map.keys().any(|key| key == \"_\")\n    {\n        // No default provided; make sure every expected function is covered","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/library/compiler-builtins/crates/libm-macros/src/lib.rs#L261-L297","documentation":"`emit_types` accepts either the single keyword `all` or an explicit list of type identifiers (lib.rs:258-284). When `all` appears, validate() sets add_all_types and then asserts emit_types has length 1; any companion identifier makes the request ambiguous and is rejected.","triggerScenarios":"Writing `emit_types: [all, CFn]`, `emit_types: [CFn, all]`, or otherwise mixing the `all` keyword with other type identifiers.","commonSituations":"Appending a type to an existing `all` entry, or trying to be explicit alongside `all` for clarity.","solutions":["Use emit_types: all by itself.","Or drop `all` and list each of the seven known types explicitly."],"exampleFix":"// before\nemit_types: [all, CFn],\n// after\nemit_types: all,","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat `all` as mutually exclusive with every other emit_types entry.","If you need to document which types `all` expands to, put that in a comment, not in the list."],"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"}