Skip to content

Commit

Permalink
fix(embedded): Rely on new defaulted version field
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 6, 2023
1 parent c0f7646 commit f5de30f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/cargo/util/toml/embedded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::Config;

const DEFAULT_EDITION: crate::core::features::Edition =
crate::core::features::Edition::LATEST_STABLE;
const DEFAULT_VERSION: &str = "0.0.0";
const DEFAULT_PUBLISH: bool = false;
const AUTO_FIELDS: &[&str] = &["autobins", "autoexamples", "autotests", "autobenches"];

Expand Down Expand Up @@ -123,9 +122,6 @@ fn expand_manifest_(
package
.entry("name".to_owned())
.or_insert(toml::Value::String(name));
package
.entry("version".to_owned())
.or_insert_with(|| toml::Value::String(DEFAULT_VERSION.to_owned()));
package.entry("edition".to_owned()).or_insert_with(|| {
let _ = config.shell().warn(format_args!(
"`package.edition` is unspecified, defaulting to `{}`",
Expand Down Expand Up @@ -622,7 +618,6 @@ build = false
edition = "2021"
name = "test-"
publish = false
version = "0.0.0"
[profile.release]
strip = true
Expand Down Expand Up @@ -652,7 +647,6 @@ build = false
edition = "2021"
name = "test-"
publish = false
version = "0.0.0"
[profile.release]
strip = true
Expand Down
1 change: 0 additions & 1 deletion src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,6 @@ at the start of the infostring at the top of the file.

Inferred / defaulted manifest fields:
- `package.name = <slugified file stem>`
- `package.version = "0.0.0"` to [call attention to this crate being used in unexpected places](https://matklad.github.io/2021/08/22/large-rust-workspaces.html#Smaller-Tips)
- `package.publish = false` to avoid accidental publishes, particularly if we
later add support for including them in a workspace.
- `package.edition = <current>` to avoid always having to add an embedded
Expand Down

0 comments on commit f5de30f

Please sign in to comment.