diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-05-22 22:29:13 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2014-05-24 16:49:46 -0700 |
| commit | 864c5016ae5492da8130bf3c1c2d5ef04b66efa7 (patch) | |
| tree | 478437afc5d6c8ae77f1ed9ef9db48a0703bd919 /src/libsyntax | |
| parent | 24f98c6d7a1dcf878e13f506d9b164fa54657503 (diff) | |
| download | rust-864c5016ae5492da8130bf3c1c2d5ef04b66efa7.tar.gz rust-864c5016ae5492da8130bf3c1c2d5ef04b66efa7.zip | |
Get "make check" to work with unused-attribute
There's a fair number of attributes that have to be whitelisted since they're either looked for by rustdoc, in trans, or as needed. These can be cleaned up in the future.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index bbd333163b5..1d43ac898f1 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -350,9 +350,9 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>> // this would be much nicer as a chain of iterator adaptors, but // this doesn't work. - let some_cfg_matches = metas.any(|mi| { + let some_cfg_matches = metas.fold(false, |matches, mi| { debug!("testing name: {}", mi.name()); - if mi.check_name("cfg") { // it is a #[cfg()] attribute + let this_matches = if mi.check_name("cfg") { // it is a #[cfg()] attribute debug!("is cfg"); no_cfgs = false; // only #[cfg(...)] ones are understood. @@ -380,7 +380,8 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>> } } else { false - } + }; + matches || this_matches }); debug!("test_cfg (no_cfgs={}, some_cfg_matches={})", no_cfgs, some_cfg_matches); no_cfgs || some_cfg_matches |
