Skip to content

Commit f7b8bf3

Browse files
committed
fix: Call out precedence downsides
1 parent c650af3 commit f7b8bf3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

text/3502-cargo-script.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ case that a `Cargo.toml` would.
425425
With lockfile "hidden away" in the `target/`,
426426
users might not be aware that they are using old dependencies.
427427

428+
The precedence schema for `cargo foo` has limitations
429+
- If your script has the same name as a built-in subcommand, then you have to prefix it with `./`
430+
- If you browse a random repo and try to run one of your aliases or third-party commands, you could unintentionally get a local script instead.
431+
- If `PATH` is unset or set to an empty string, then running `build` will run `cargo build` and run the built-in `build` command rather than your script
432+
428433
# Rationale and alternatives
429434
[rationale-and-alternatives]: #rationale-and-alternatives
430435

0 commit comments

Comments
 (0)