{"record":{"id":"3877cbd83c8c8cb5","repo":"astrid-runtime/astrid","slug":"cargo-rustflags-must-be-a-string-or-array-in","errorCode":null,"errorMessage":"Cargo rustflags must be a string or array in {}","messagePattern":"Cargo rustflags must be a string or array in (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust/config.rs","lineNumber":424,"sourceCode":"                    anyhow::anyhow!(\n                        \"Cargo rustflags array contains a non-string value in {}\",\n                        path.display()\n                    )\n                })\n            })\n            .collect::<Result<Vec<_>>>()?;\n        return Ok(ParsedRustflags {\n            flags,\n            is_array: true,\n        });\n    }\n    if let Some(value) = item.as_str() {\n        return Ok(ParsedRustflags {\n            flags: value.split_whitespace().map(str::to_owned).collect(),\n            is_array: false,\n        });\n    }\n    bail!(\n        \"Cargo rustflags must be a string or array in {}\",\n        path.display()\n    )\n}\n\nfn merge_rustflags(slot: &mut Option<ParsedRustflags>, incoming: ParsedRustflags) {\n    if let Some(existing) = slot\n        && existing.is_array\n        && incoming.is_array\n    {\n        existing.flags.extend(incoming.flags);\n    } else {\n        *slot = Some(incoming);\n    }\n}\n\npub(super) fn cargo_home_from_env(dir: &Path) -> Option<PathBuf> {\n    if let Some(home) = std::env::var_os(\"CARGO_HOME\")","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust/config.rs#L406-L442","documentation":"Type-dispatch fallback in parse_rustflags: the rustflags value in the Cargo config is neither an array nor a string — the only supported encodings. Anything else (integer, boolean, nested table) cannot be split into compiler flags, so absorb_document aborts and names the offending config file.","triggerScenarios":"Thrown at crates/astrid-build/src/rust/config.rs:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use `rustflags = [\"-C\", \"...\"]` array form or a single quoted string","Fix the TOML type in the offending config file","Remove unrelated keys from rustflags"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}