diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 5dcdd2ff4ed..b9aa42fc4cb 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -50,8 +50,17 @@ struct ArchiveFile { enum FileContents { /// Absolute path to the file on disk to add to the archive. OnDisk(PathBuf), - /// Contents of a file generated in memory. - Generated(String), + /// Generates a file. + Generated(GeneratedFile), +} + +enum GeneratedFile { + /// Generates `Cargo.toml` by rewriting the original. + Manifest, + /// Generates `Cargo.lock` in some cases (like if there is a binary). + Lockfile, + /// Adds a `.cargo-vcs_info.json` file if in a (clean) git repo. + VcsInfo(String), } pub fn package(ws: &Workspace<'_>, opts: &PackageOpts<'_>) -> CargoResult> { @@ -71,8 +80,6 @@ pub fn package(ws: &Workspace<'_>, opts: &PackageOpts<'_>) -> CargoResult