Auto merge of #5270 - djc:feature-requirements, r=Eh2406
authorbors <bors@rust-lang.org>
Wed, 4 Apr 2018 16:28:33 +0000 (16:28 +0000)
committerbors <bors@rust-lang.org>
Wed, 4 Apr 2018 16:28:33 +0000 (16:28 +0000)
Introduce FeatureValue type to represent features table values

This is the next step towards #1286 (after #5258). The goal here is to have a central place in the code where feature strings are interpreted as (a) a feature, (b) a dependency or (c) a dependency/feature combo, and anchor that interpretation in the type system as an enum.

I've spent quite a bit of effort avoiding extra string allocations, complicating the code a bit; notice in particular the use of `Cow<str>` in `FeatureValue` variants, and the slight workaround in `Context::resolve_features()` and `build_requirements()`. I hope this is all okay.

cc @Eh2406


Trivial merge