@@ -1385,7 +1385,7 @@ Valid operations are the following:
13851385
13861386Cargo can directly run ` .rs ` files as:
13871387``` console
1388- $ cargo -Zscript file.rs
1388+ $ cargo +nightly -Zscript file.rs
13891389```
13901390where ` file.rs ` can be as simple as:
13911391``` rust
@@ -1423,6 +1423,9 @@ files), we are adding the concept of single-file packages which may contain an
14231423embedded manifest. There is no required distinguishment for a single-file
14241424` .rs ` package from any other ` .rs ` file.
14251425
1426+ Single-file packages may be selected via ` --manifest-path ` , like
1427+ ` cargo test --manifest-path foo.rs ` . Unlike ` Cargo.toml ` , these files cannot be auto-discovered.
1428+
14261429A single-file package may contain an embedded manifest. An embedded manifest
14271430is stored using ` TOML ` in a markdown code-fence with ` cargo ` at the start of the
14281431infostring inside a target-level doc-comment. It is an error to have multiple
@@ -1448,18 +1451,16 @@ Inferred / defaulted manifest fields:
14481451 later add support for including them in a workspace.
14491452- ` package.edition = <current> ` to avoid always having to add an embedded
14501453 manifest at the cost of potentially breaking scripts on rust upgrades
1451- - Warn when ` edition ` is unspecified. While with single-file packages this will be
1452- silenced by default, users wanting stability are also likely to be using
1453- other commands, like ` cargo test ` and will see it.
1454+ - Warn when ` edition ` is unspecified to raise awareness of this
14541455
14551456Disallowed manifest fields:
14561457- ` [workspace] ` , ` [lib] ` , ` [[bin]] ` , ` [[example]] ` , ` [[test]] ` , ` [[bench]] `
14571458- ` package.workspace ` , ` package.build ` , ` package.links ` , ` package.autobins ` , ` package.autoexamples ` , ` package.autotests ` , ` package.autobenches `
14581459
1459- As the primary role for these files is exploratory programming which has a high
1460- edit-to-run ratio, building should be fast. Therefore ` CARGO_TARGET_DIR ` will
1461- be shared between single-file packages to allow reusing intermediate build
1462- artifacts.
1460+ The default ` CARGO_TARGET_DIR ` for single-file packages is at ` $CARGO_HOME/target/<hash> ` :
1461+ - Avoid conflicts from multiple single-file packages being in the same directory
1462+ - Avoid problems with the single-file package's parent directory being read-only
1463+ - Avoid cluttering the user's directory
14631464
14641465The lockfile for single-file packages will be placed in ` CARGO_TARGET_DIR ` . In
14651466the future, when workspaces are supported, that will allow a user to have a
0 commit comments