diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-10-11 18:05:54 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2014-10-12 11:40:19 -0700 |
| commit | aa3b1261b164eeac3e68573bfc698d1ca943fb05 (patch) | |
| tree | 782e225f5db942be43f37941fa0d1ce70fd63dac /src/libsyntax/config.rs | |
| parent | cd1fa91d2bf97a6331e1d0265eec0f3324191f89 (diff) | |
| download | rust-aa3b1261b164eeac3e68573bfc698d1ca943fb05.tar.gz rust-aa3b1261b164eeac3e68573bfc698d1ca943fb05.zip | |
Continue cfg syntax transition
All deprecation warnings have been converted to errors. This includes the warning for multiple cfgs on one item. We'll leave that as an error for some period of time to ensure that all uses are updated before the behavior changes from "or" to "and".
Diffstat (limited to 'src/libsyntax/config.rs')
| -rw-r--r-- | src/libsyntax/config.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 9b4748f88ab..3511e167e97 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -261,20 +261,20 @@ fn in_cfg(diagnostic: &SpanHandler, cfg: &[P<ast::MetaItem>], attrs: &[ast::Attr }; if mis.len() != 1 { - diagnostic.span_warn(attr.span, "The use of multiple cfgs in the top level of \ - `#[cfg(..)]` is deprecated. Change `#[cfg(a, b)]` to \ - `#[cfg(all(a, b))]`."); + diagnostic.span_err(attr.span, "expected 1 cfg-pattern"); + return false; } if seen_cfg { - diagnostic.span_warn(attr.span, "The semantics of multiple `#[cfg(..)]` attributes on \ - same item are changing from the union of the cfgs to \ - the intersection of the cfgs. Change `#[cfg(a)] \ - #[cfg(b)]` to `#[cfg(any(a, b))]`."); + diagnostic.span_err(attr.span, "The semantics of multiple `#[cfg(..)]` attributes on \ + same item are changing from the union of the cfgs to \ + the intersection of the cfgs. Change `#[cfg(a)] \ + #[cfg(b)]` to `#[cfg(any(a, b))]`."); + return false; } seen_cfg = true; - in_cfg |= mis.iter().all(|mi| attr::cfg_matches(diagnostic, cfg, &**mi)); + in_cfg |= attr::cfg_matches(diagnostic, cfg, &*mis[0]); } in_cfg | !seen_cfg } |
