Skip to content

Commit

Permalink
Turn on cfg format warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Sep 30, 2014
1 parent fa6b2d4 commit 92013a8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,11 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::Me
ast::MetaList(ref pred, ref mis) if pred.get() == "all" =>
mis.iter().all(|mi| cfg_matches(diagnostic, cfgs, &**mi)),
ast::MetaList(ref pred, ref mis) if pred.get() == "not" => {
// NOTE: turn on after snapshot
/*
if mis.len() != 1 {
diagnostic.span_warn(cfg.span, "the use of multiple cfgs in the same `not` \
statement is deprecated. Change `not(a, b)` to \
`not(all(a, b))`.");
}
*/
!mis.iter().all(|mi| cfg_matches(diagnostic, cfgs, &**mi))
}
ast::MetaList(ref pred, _) => {
Expand Down
3 changes: 0 additions & 3 deletions src/libsyntax/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ fn in_cfg(diagnostic: &SpanHandler, cfg: &[P<ast::MetaItem>], attrs: &[ast::Attr
_ => continue
};

// NOTE: turn on after snapshot
/*
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 \
Expand All @@ -274,7 +272,6 @@ fn in_cfg(diagnostic: &SpanHandler, cfg: &[P<ast::MetaItem>], attrs: &[ast::Attr
the intersection of the cfgs. Change `#[cfg(a)] \
#[cfg(b)]` to `#[cfg(any(a, b))]`.");
}
*/

seen_cfg = true;
in_cfg |= mis.iter().all(|mi| attr::cfg_matches(diagnostic, cfg, &**mi));
Expand Down
3 changes: 0 additions & 3 deletions src/libsyntax/ext/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ pub fn expand_cfg<'cx>(cx: &mut ExtCtxt,
p.expect(&token::COMMA);
}

// NOTE: turn on after snapshot
/*
if cfgs.len() != 1 {
cx.span_warn(sp, "The use of multiple cfgs at the top level of `cfg!` \
is deprecated. Change `cfg!(a, b)` to \
`cfg!(all(a, b))`.");
}
*/

let matches_cfg = cfgs.iter().all(|cfg| attr::cfg_matches(&cx.parse_sess.span_diagnostic,
cx.cfg.as_slice(), &**cfg));
Expand Down

0 comments on commit 92013a8

Please sign in to comment.