cargo/tests
bors 78109c0d2c Auto merge of #13071 - LuuuXXX:issue-11010, r=epage
Have cargo add --optional <dep> create a <dep> = "dep:<dep> feature

### What does this PR try to resolve?

`cargo add --optional <dep>` would create a `<dep> = "dep:<dep>` feature iff

- `rust-version` is unset or is new enough for the syntax
- `dep:<dep>` doesn't already exist

Fixes https://github.com/rust-lang/cargo/issues/11010

### How should we test and review this PR?

As the `dep:` syntax is only available starting with Rust 1.60. this pr maintains the previous usage convention in the earlier version.

run

```shell
cargo add --optional <dep>
```

with different rust-version to verify.
2023-12-01 18:13:54 +00:00
..
build-std fix: reorder --remap-path-prefix flags for -Zbuild-std 2023-11-28 15:29:03 -05:00
testsuite Auto merge of #13071 - LuuuXXX:issue-11010, r=epage 2023-12-01 18:13:54 +00:00