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

Tweak features for regex-syntax #665

Merged
merged 1 commit into from
Apr 17, 2020

Commits on Apr 17, 2020

  1. Tweak features for regex-syntax

    This commit tweaks the features enabled for the `regex-syntax` crate
    from the `regex` crate itself. This isn't intended to actually have any
    functional change, but should help feature unification for Cargo in some
    projects.
    
    One project I work on exhibits an issue where executing `cargo build`
    followed by `cargo test` will rebuild `regex-syntax` and all of its
    transitive dependencies. The cause for this issue is that the tests are
    using the `proptest` crate. The `proptest` crate depends on
    `regex-syntax` with normal features (e.g. the defaults). All other
    crates depend on `regex` with normal default features too.
    
    The problem happens where when *only* the `regex` crate depends on
    `regex-syntax` then the `default` and `unicode` features of
    `regex-syntax` are disabled. This is because the `regex` crate disables
    default features and `regex`'s `unicode` feature delegates to all the
    individual features of `regex-syntax`. When the `regex-syntax` crate is
    depended on directly by `proptest` it then enables the `default` and
    `unicode` features of `regex-syntax`.
    
    Functionally these two builds of `regex-syntax` are exactly the same
    since `default` is simply a proxy for `unicode` and `unicode` is simply
    an umbrella including other features.
    
    This PR updates the features enabled on `regex-syntax` by the `regex`
    crate in two ways:
    
    * The `default` feature for `regex` enables `regex-syntax/default`.
    * The `unicode` feature for `regex` enables the `regex-syntax/unicode`
      feature.
    
    This makes is so that if another crate in your crate graph depends on
    `regex-syntax` then it'll have, by default, the same set of features
    enabled than if you also depend on `regex`.
    alexcrichton committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    fa531ce View commit details
    Browse the repository at this point in the history