diff options
| author | Urgau <urgau@numericable.fr> | 2023-12-29 23:16:10 +0100 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-01-09 19:03:06 +0100 |
| commit | 15078c25d692233b7d7a0ba8b977326929320887 (patch) | |
| tree | 1d3b297dbf24634ea8c0c007504f4db5fd5cb969 /compiler/rustc_interface/src/interface.rs | |
| parent | 5876c8cdfd3df742c334d6447d44d760c77103b6 (diff) | |
| download | rust-15078c25d692233b7d7a0ba8b977326929320887.tar.gz rust-15078c25d692233b7d7a0ba8b977326929320887.zip | |
Add explicit none() value variant in check-cfg
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 6c000380e71..6787250b097 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -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 { |
