Skip to content

Commit

Permalink
fix(embedded): Rely on package.publish default for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 11, 2023
1 parent 29c3570 commit 020d341
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 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_PUBLISH: bool = false;
const AUTO_FIELDS: &[&str] = &["autobins", "autoexamples", "autotests", "autobenches"];

pub fn expand_manifest(
Expand Down Expand Up @@ -132,9 +131,6 @@ fn expand_manifest_(
package
.entry("build".to_owned())
.or_insert_with(|| toml::Value::Boolean(false));
package
.entry("publish".to_owned())
.or_insert_with(|| toml::Value::Boolean(DEFAULT_PUBLISH));
for field in AUTO_FIELDS {
package
.entry(field.to_owned())
Expand Down Expand Up @@ -617,7 +613,6 @@ autotests = false
build = false
edition = "2021"
name = "test-"
publish = false
[profile.release]
strip = true
Expand Down Expand Up @@ -646,7 +641,6 @@ autotests = false
build = false
edition = "2021"
name = "test-"
publish = false
[profile.release]
strip = true
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,6 @@ at the start of the infostring at the top of the file.

Inferred / defaulted manifest fields:
- `package.name = <slugified file stem>`
- `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
manifest at the cost of potentially breaking scripts on rust upgrades
- Warn when `edition` is unspecified to raise awareness of this
Expand Down

0 comments on commit 020d341

Please sign in to comment.