Weihang Lo 32497862ac
Clarify warning for using features or default-features in patch (#15953)
### What does this PR try to resolve?

When attempting to substitute a local version of a dependency, since the
`patch` section uses syntax similar to a dependency (and the
documentation even says "The syntax is similar to the `[dependencies]`
section", it's natural to assume that other things from `[dependencies]`
also work, such as `features` or `default-features`. Attempting to use
them produces this warning:

> patch for `crate-name-here` uses the features mechanism.
> default-features and features will not take effect because the patch
dependency does not support this mechanism

The phrasing "the patch dependency does not support this mechanism"
makes it seem at first glance like `patch` just doesn't support this at
all. But the actual problem is that the user needs to move the
`features`/`default-features` keys to an entry in `dependencies`
instead.

Closes #13522

### How to test and review this PR?

This applies the review feedback from #13522 that the author didn't have
a chance to get back to.
2025-09-13 20:11:08 +00:00
..