{"record":{"id":"0348c150bf3f36e8","repo":"zed-industries/zed","slug":"invalid-version-in-cargo-toml","errorCode":null,"errorMessage":"invalid version in Cargo.toml","messagePattern":"invalid version in Cargo\\.toml","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/release_channel/src/lib.rs","lineNumber":107,"sourceCode":"\nstruct GlobalAppVersion(Version);\n\nimpl Global for GlobalAppVersion {}\n\n/// The version of Zed.\npub struct AppVersion;\n\nimpl AppVersion {\n    /// Load the app version from env.\n    pub fn load(\n        pkg_version: &str,\n        build_id: Option<&str>,\n        commit_sha: Option<AppCommitSha>,\n    ) -> Version {\n        let mut version: Version = if let Ok(from_env) = env::var(\"ZED_APP_VERSION\") {\n            from_env.parse().expect(\"invalid ZED_APP_VERSION\")\n        } else {\n            pkg_version.parse().expect(\"invalid version in Cargo.toml\")\n        };\n        let mut pre = String::from(RELEASE_CHANNEL.dev_name());\n\n        if let Some(build_id) = build_id {\n            pre.push('.');\n            pre.push_str(&build_id);\n        }\n\n        if let Some(sha) = commit_sha {\n            pre.push('.');\n            pre.push_str(&sha.0);\n        }\n        if let Ok(build) = semver::BuildMetadata::new(&pre) {\n            version.build = build;\n        }\n\n        version\n    }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/release_channel/src/lib.rs#L89-L125","documentation":"AppVersion::load panics because the version string baked from Cargo.toml (pkg_version) failed semver parsing. This indicates the crate's version metadata itself is malformed — a build-time invariant violation.","triggerScenarios":"Thrown at crates/release_channel/src/lib.rs:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the version field in the crate's Cargo.toml to valid semver","Check any script that rewrites or injects the version at build time","Fall back to a hardcoded default with logging if parse fails"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}