Skip to content

Instantly share code, notes, and snippets.

@Urgau
Created February 21, 2022 12:13
Show Gist options
  • Save Urgau/ca39ad2064c0a1094ff9b76bbc413247 to your computer and use it in GitHub Desktop.
Save Urgau/ca39ad2064c0a1094ff9b76bbc413247 to your computer and use it in GitHub Desktop.
Draft of an potential interface for `--check-cfg` in `Cargo.toml`
[package]
# ...
[check-cfg] # or [package.check-cfg] ?
well-known = true # this only and exclusively control the names() part
# aka as the well-known names (or values, maybe) in rustc
# this default to true
names = ["no_global_oom_handling"] # this is the names(...) part, this
# only check the name part of the cfg
# and never the value of it (except if
# defined below in values, or by cmd)
[[check-cfg.values]] # this is the values(...) part
name = "use_libc" # this is not equivalent to just putting the name in
# package.cfg.check.names as this defines an implicit
# values = [], meaning that no values are allowed
[[check-cfg.values]]
name = "feature" # feature will be automatically set by cargo, but
# could still be extented
values = ["foo", "bar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment