fix and rebase

This commit is contained in:
Oliver Schneider 2016-03-14 10:18:09 +01:00
parent 077481053c
commit aa1ecb6fce
2 changed files with 7 additions and 8 deletions

View File

@ -85,14 +85,13 @@ impl<'a, 'b, 'c> SimilarNamesNameVisitor<'a, 'b, 'c> {
return;
}
self.0.single_char_names.push(c);
if self.0.single_char_names.len() < self.0.lint.max_single_char_names {
return;
if self.0.single_char_names.len() >= self.0.lint.max_single_char_names {
span_lint(self.0.cx,
MANY_SINGLE_CHAR_NAMES,
span,
&format!("{}th binding whose name is just one char",
self.0.single_char_names.len()));
}
span_lint(self.0.cx,
MANY_SINGLE_CHAR_NAMES,
span,
&format!("{}th binding whose name is just one char",
self.0.single_char_names.len()));
return;
}
for &allow in WHITELIST {

View File

@ -3,7 +3,7 @@
#![allow(dead_code)]
#![allow(single_match)]
#![allow(unused_variables)]
#![allow(unused_variables, similar_names)]
#![deny(blacklisted_name)]
fn test(foo: ()) {} //~ERROR use of a blacklisted/placeholder name `foo`