-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specifying features with commas
feat1,feat2
(#918)
- Loading branch information
1 parent
8b2a51b
commit 269f88b
Showing
7 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
publish = false | ||
name = "feature_flags_validation" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
||
[features] | ||
default = ["std", "alloc"] | ||
foo = [] | ||
std = [] | ||
bar = [] | ||
alloc = [] | ||
unstable = [] | ||
nightly = [] | ||
bench = [] | ||
no_std = [] | ||
__foo = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#[cfg(feature = "foo")] | ||
pub fn foo_becomes_gated() {} | ||
|
||
#[cfg(feature = "bar")] | ||
pub fn bar_becomes_gated() {} | ||
|
||
#[cfg(any(feature = "unstable", feature = "nightly",))] | ||
pub fn unstable_function() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
publish = false | ||
name = "feature_flags_validation" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
||
[features] | ||
default = ["std", "alloc"] | ||
std = [] | ||
alloc = [] | ||
unstable = [] | ||
nightly = [] | ||
bench = [] | ||
no_std = [] | ||
__foo = [] | ||
unstable-foo=[] | ||
unstable_foo=[] | ||
_bar=[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#[cfg(not(all(feature = "std", feature = "alloc")))] | ||
compile_error!("`std` and `alloc` features are currently required to build this awesome crate"); | ||
|
||
pub fn foo_becomes_gated() {} | ||
pub fn bar_becomes_gated() {} | ||
|
||
#[cfg(any( | ||
feature = "unstable", | ||
feature = "nightly", | ||
feature = "bench", | ||
feature = "no_std", | ||
feature = "__foo", | ||
feature = "unstable-foo", | ||
feature = "unstable_foo", | ||
feature = "_bar" | ||
))] | ||
pub fn unstable_function() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters