Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify warning for using features or default-features in patch #13522

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 3, 2024

  1. Clarify warning for using features or default-features in patch

    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.
    
    Modify the message, to make this more obvious.
    
    Modify the corresponding warning for `replace` as well.
    
    Update tests accordingly.
    joshtriplett committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    8505f7f View commit details
    Browse the repository at this point in the history