{"record":{"id":"622a06556ff247f0","repo":"rust-lang/rust","slug":"unsupported-channel","errorCode":null,"errorMessage":"unsupported channel: {}","messagePattern":"unsupported channel: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/bump-stage0/src/main.rs","lineNumber":29,"sourceCode":"const RUSTFMT_COMPONENTS: &[&str] = &[\"rustfmt-preview\", \"rustc\"];\n\nstruct Tool {\n    config: Stage0Config,\n\n    channel: Channel,\n    compiler_date: Option<String>,\n    rustfmt_date: Option<String>,\n    version: [u16; 3],\n    checksums: IndexMap<String, String>,\n}\n\nimpl Tool {\n    fn new(compiler_date: Option<String>, rustfmt_date: Option<String>) -> Result<Self, Error> {\n        let channel = match std::fs::read_to_string(\"src/ci/channel\")?.trim() {\n            \"stable\" => Channel::Stable,\n            \"beta\" => Channel::Beta,\n            \"nightly\" => Channel::Nightly,\n            other => anyhow::bail!(\"unsupported channel: {}\", other),\n        };\n\n        // Split \"1.42.0\" into [1, 42, 0]\n        let version = std::fs::read_to_string(\"src/version\")?\n            .trim()\n            .split('.')\n            .map(|val| val.parse())\n            .collect::<Result<Vec<_>, _>>()?\n            .try_into()\n            .map_err(|_| anyhow::anyhow!(\"failed to parse version\"))?;\n\n        let existing = parse_stage0_file();\n\n        Ok(Self {\n            channel,\n            version,\n            compiler_date,\n            rustfmt_date,","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/bump-stage0/src/main.rs#L11-L47","documentation":"Thrown by Tool::new in bump-stage0 when the contents of src/ci/channel (trimmed) is not exactly 'stable', 'beta', or 'nightly'. The channel string drives which manifest and which components (e.g. rustfmt only on nightly) are fetched, so an unrecognized value cannot be processed.","triggerScenarios":"Running bump-stage0 from a branch where src/ci/channel contains an experimental or custom release-channel name; the file has trailing whitespace or a different casing (e.g. 'Nightly'); the file was accidentally overwritten or is empty.","commonSituations":"Fork using a custom channel name; merge accidentally clobbered src/ci/channel; building from a worktree where the file is missing.","solutions":["Inspect src/ci/channel and ensure it is exactly one of: stable, beta, nightly (no extra whitespace/casing).","If you intentionally use a custom channel, extend the match in Tool::new to map it to a Channel variant.","Restore the file from the upstream branch if it was clobbered."],"exampleFix":"// before\n$ cat src/ci/channel\nnightly-test\n\n// after\n$ echo nightly > src/ci/channel","handlingStrategy":"validation","validationCode":"// Validate the channel file before constructing the Tool.\nlet channel = std::fs::read_to_string(\"src/ci/channel\")?.trim().to_string();\nif !matches!(channel.as_str(), \"stable\" | \"beta\" | \"nightly\") {\n    eprintln!(\"src/ci/channel is '{channel}', expected stable|beta|nightly\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep src/ci/channel to exactly one of the three supported values.","If you fork to a custom channel, extend the match in Tool::new deliberately.","Re-check the file after merges that might clobber it."],"tags":["bump-stage0","configuration","release-channel"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}