diff options
| author | bors <bors@rust-lang.org> | 2014-10-13 12:27:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-13 12:27:43 +0000 |
| commit | d670d762214175bb2283a6401153b8175fb8a907 (patch) | |
| tree | f2f836d78b11fb72be67a303f45bf7b2c06be8fb /src/libsyntax/config.rs | |
| parent | 7dbd4349c406b997b486426d2e3aa9f2cc1fbd0c (diff) | |
| parent | aa3b1261b164eeac3e68573bfc698d1ca943fb05 (diff) | |
| download | rust-d670d762214175bb2283a6401153b8175fb8a907.tar.gz rust-d670d762214175bb2283a6401153b8175fb8a907.zip | |
auto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichton
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 a53be6097fd..8824a937038 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -259,20 +259,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 } |
