1
Fork 0

Add explicit none() value variant in check-cfg

This commit is contained in:
Urgau 2023-12-29 23:16:10 +01:00
parent 5876c8cdfd
commit 15078c25d6
12 changed files with 101 additions and 6 deletions

View file

@ -199,8 +199,15 @@ pub(crate) fn parse_check_cfg(dcx: &DiagCtxt, specs: Vec<String>) -> CheckCfg {
if !args.is_empty() {
error!("`any()` must be empty");
}
} else if arg.has_name(sym::none)
&& let Some(args) = arg.meta_item_list()
{
values.insert(None);
if !args.is_empty() {
error!("`none()` must be empty");
}
} else {
error!("`values()` arguments must be string literals or `any()`");
error!("`values()` arguments must be string literals, `none()` or `any()`");
}
}
} else {