From 298a6e66579e5e56fbe2d67f9a4b92f6e1e58ccc Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 20 Apr 2015 22:55:36 +0200 Subject: [PATCH] lint: explain the non-obvious need for a negative test --- src/librustc_lint/builtin.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 7f1a4b659ed..c12ac501c45 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -923,6 +923,8 @@ impl NonSnakeCase { allow_underscore = match c { '_' if !allow_underscore => return false, '_' => false, + // It would be more obvious to use `c.is_lowercase()`, + // but some characters do not have a lowercase form c if !c.is_uppercase() => true, _ => return false, };