@@ -213,25 +213,31 @@ the [`perf` feature], then the oldest version it can select is `1.3.0`,
213
213
because versions prior to that did not contain the ` perf ` feature. Similarly,
214
214
if a feature is removed from a new release, then packages that require that
215
215
feature will be stuck on the older releases that contain that feature. It is
216
- discouraged to remove features in a SemVer-compatible release.
216
+ discouraged to remove features in a SemVer-compatible release. Beware that
217
+ optional dependencies also define an implicit feature, so removing an optional
218
+ dependency or making it non-optional can cause problems, see [ removing an
219
+ optional dependency] .
217
220
218
221
[ `im` ] : https://crates.io/crates/im
219
222
[ `perf` feature ] : https://github.com/rust-lang/regex/blob/1.3.0/Cargo.toml#L56
220
223
[ `rayon` dependency ] : https://github.com/bodil/im-rs/blob/v15.0.0/Cargo.toml#L47
221
224
[ `regex` ] : https://crates.io/crates/regex
222
225
[ `serde` dependency ] : https://github.com/bodil/im-rs/blob/v15.0.0/Cargo.toml#L46
223
226
[ features ] : features.md
227
+ [ removing an optional dependency ] : semver.md#cargo-remove-opt-dep
224
228
[ workspace ] : workspaces.md
225
229
226
230
### ` links `
227
231
228
232
The [ ` links ` field] is used to ensure only one copy of a native library is
229
- linked into a binary. It is an error if multiple SemVer-incompatible versions
230
- of a package with a ` links ` field appears in the resolve graph. For example,
231
- it is an error if one package depends on [ ` libgit2-sys ` ] version ` 0.11 ` and
232
- another depends on ` 0.12 ` , because Cargo is unable to unify those, but they
233
- both link to the ` git2 ` native library. Due to this rigid requirement, it is
234
- encouraged to be very careful when making SemVer-incompatible releases with
233
+ linked into a binary. The resolver will attempt to find a graph where there is
234
+ only one instance of each ` links ` name. If it is unable to find a graph that
235
+ satisfies that constraint, it will return an error.
236
+
237
+ For example, it is an error if one package depends on [ ` libgit2-sys ` ] version
238
+ ` 0.11 ` and another depends on ` 0.12 ` , because Cargo is unable to unify those,
239
+ but they both link to the ` git2 ` native library. Due to this requirement, it
240
+ is encouraged to be very careful when making SemVer-incompatible releases with
235
241
the ` links ` field if your library is in common use.
236
242
237
243
[ `links` field ] : manifest.md#the-links-field
0 commit comments