{"record":{"id":"e26137483cdc904c","repo":"cross-rs/cross","slug":"rust-std-is-not-available-for-target","errorCode":null,"errorMessage":"rust-std is not available for {target}","messagePattern":"rust-std is not available for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib.rs","lineNumber":486,"sourceCode":"    pub fn uses_zig(self) -> bool {\n        self == CommandVariant::Zig\n    }\n\n    pub(crate) fn is_shell(self) -> bool {\n        self == CommandVariant::Shell\n    }\n}\n\nfn warn_on_failure(\n    target: &Target,\n    toolchain: &QualifiedToolchain,\n    msg_info: &mut MessageInfo,\n) -> Result<()> {\n    let rust_std = format!(\"rust-std-{target}\");\n    if target.is_builtin() {\n        let component = rustup::check_component(&rust_std, toolchain, msg_info)?;\n        if component.is_not_available() {\n            msg_info.warn(format_args!(\"rust-std is not available for {target}\"))?;\n            msg_info.note(\n                format_args!(\n                    r#\"you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.{target}.build-std`\n              the available components are core, std, alloc, and proc_macro\"#\n                ),\n            )?;\n        }\n    }\n    Ok(())\n}\n\nfn add_libc_version(triple: &str, zig_version: Option<&str>) -> String {\n    match zig_version {\n        Some(libc) => format!(\"{triple}.{libc}\"),\n        None => triple.to_owned(),\n    }\n}\n","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/cross-rs/cross/blob/8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27/src/lib.rs#L468-L504","documentation":"Warning raised in warn_on_failure after a target build/command fails: the target requested is a builtin target, and rustup reports that the rust-std component (rust-std-{target}) is not available for the selected toolchain. This usually means the target is not installed on that toolchain, so cross reminds the user to add the component before retrying.","triggerScenarios":"Thrown at src/lib.rs:486 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `rustup target add <target>` for the toolchain in use","Switch to a toolchain that ships the rust-std component for this target","If the target genuinely has no rust-std for any toolchain, use a custom target specification JSON with a core built for it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27","analyzedAt":"2026-09-13T15:10:43.988Z","contentChangedAt":"2026-09-13T15:10:43.988Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}