diff --git a/crates/cargo-util-schemas/index.schema.json b/crates/cargo-util-schemas/index.schema.json index 8901dc4718c..189ee19fd83 100644 --- a/crates/cargo-util-schemas/index.schema.json +++ b/crates/cargo-util-schemas/index.schema.json @@ -69,7 +69,7 @@ ] }, "pubtime": { - "description": "The publish time for the package. Unstable.\n\nIn ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z)\n\nThis should be the original publish time and not changed on any status changes,\nlike [`IndexPackage::yanked`].", + "description": "The publish time of this package version (optional).\n\nThe format is a subset of ISO8601:\n- `yyyy-mm-ddThh:mm:ssZ`\n- no fractional seconds\n- always `Z` for UTC timezone, no timezone offsets supported\n- fields are 0-padded\n\nExample: 2025-11-12T19:30:12Z\n\nThis should be the original publish time and not changed on any status changes,\nlike [`IndexPackage::yanked`].", "type": [ "string", "null" diff --git a/crates/cargo-util-schemas/src/index.rs b/crates/cargo-util-schemas/src/index.rs index 0b029ce15ab..5f58dfadb7c 100644 --- a/crates/cargo-util-schemas/src/index.rs +++ b/crates/cargo-util-schemas/src/index.rs @@ -46,9 +46,15 @@ pub struct IndexPackage<'a> { /// can be `None` if published before then or if not set in the manifest. #[cfg_attr(feature = "unstable-schema", schemars(with = "Option"))] pub rust_version: Option, - /// The publish time for the package. Unstable. + /// The publish time of this package version (optional). /// - /// In ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z) + /// The format is a subset of ISO8601: + /// - `yyyy-mm-ddThh:mm:ssZ` + /// - no fractional seconds + /// - always `Z` for UTC timezone, no timezone offsets supported + /// - fields are 0-padded + /// + /// Example: 2025-11-12T19:30:12Z /// /// This should be the original publish time and not changed on any status changes, /// like [`IndexPackage::yanked`]. diff --git a/src/doc/src/reference/registry-index.md b/src/doc/src/reference/registry-index.md index dbb7638b8bb..f982b557237 100644 --- a/src/doc/src/reference/registry-index.md +++ b/src/doc/src/reference/registry-index.md @@ -218,7 +218,20 @@ explaining the format of the entry. } // The minimal supported Rust version (optional) // This must be a valid version requirement without an operator (e.g. no `=`) - "rust_version": "1.60" + "rust_version": "1.60", + // The publish time of this package version (optional). + // + // The format is a subset of ISO8601: + // - `yyyy-mm-ddThh:mm:ssZ` + // - no fractional seconds + // - always `Z` for UTC timezone, no timezone offsets supported + // - fields are 0-padded + // + // Example: 2025-11-12T19:30:12Z + // + // This should be the original publish time and not changed on any status changes, + // like `yanked`. + "pubtime": "2025-11-12T19:30:12Z" } ``` diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index 71d674b0975..a24123a8d9c 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -1843,14 +1843,6 @@ Specify which packages participate in [feature unification](../reference/feature * `package`: Dependency features are considered on a package-by-package basis, preferring duplicate builds of dependencies when different sets of features are activated by the packages. -## pubtime - -* Original Issue: [#15491](https://github.com/rust-lang/cargo/issues/15491) -* Tracking Issue: [#16270](https://github.com/rust-lang/cargo/issues/16270) - -Documentation updates: -- Add `pubtime` field to the Index Summary description - ## lockfile-publish-time * Original Issue: [#5221](https://github.com/rust-lang/cargo/issues/5221) @@ -2273,3 +2265,7 @@ See for the reason for its remo Support for including extra configuration files via the `include` config key has been stabilized in 1.93.0. See the [`include` config documentation](config.md#include) for more. + +## pubtime + +The `pubtime` index field has been stabilized in Rust 1.94.0.