]> git.proxmox.com Git - cargo.git/commit
Auto merge of #8818 - ehuss:weak-dep-features, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 4 Nov 2020 22:20:36 +0000 (22:20 +0000)
committerbors <bors@rust-lang.org>
Wed, 4 Nov 2020 22:20:36 +0000 (22:20 +0000)
commitd5556aeb8405b1fe696adb6e297ad7a1f2989b62
treefa935928dc7a84995db2b4fb03950f7127d57436
parent862df617991a327579d1f8ee6b9e861e96fc96a9
parent9ffcf69093fe82a16a29d71101be80e9c1cefa5b
Auto merge of #8818 - ehuss:weak-dep-features, r=alexcrichton

Implement weak dependency features.

This adds the feature syntax `dep_name?/feat_name` with a `?` to only enable `feat_name` if the optional dependency `dep_name` is enabled through some other means. See `unstable.md` for documentation.

This only works with the new feature resolver. I don't think I understand the dependency resolver well enough to implement it there. It would require teaching it to defer activating a feature, but due to the backtracking nature, I don't really know how to accomplish that. I don't think it matters, the main drawback is that the dependency resolver will be slightly more constrained, but in practice I doubt it will ever matter.

Closes #3494

**Question**
* An alternate syntax I considered was `dep_name?feat_name` (without the slash), what do people think?  For some reason the `?/` seems kinda awkward to me.