]> git.lizzy.rs Git - rust.git/commitdiff
Make update_lints script accept digits in lint names
authorFlorian Hartwig <florian.j.hartwig@gmail.com>
Wed, 27 Jan 2016 19:59:19 +0000 (20:59 +0100)
committerFlorian Hartwig <florian.j.hartwig@gmail.com>
Wed, 27 Jan 2016 19:59:19 +0000 (20:59 +0100)
README.md
src/lib.rs
util/update_lints.py

index 83ff6daa9f586589597bc78332c29a18b4ad1b52..63ecbf11fcf9743debaaa3549f92bf0879bd169d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ A collection of lints to catch common mistakes and improve your Rust code.
 [Jump to usage instructions](#usage)
 
 ##Lints
-There are 98 lints included in this crate:
+There are 99 lints included in this crate:
 
 name                                                                                                           | default | meaning
 ---------------------------------------------------------------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -20,6 +20,7 @@ name
 [cast_possible_wrap](https://github.com/Manishearth/rust-clippy/wiki#cast_possible_wrap)                       | allow   | casts that may cause wrapping around the value, e.g `x as i32` where `x: u32` and `x > i32::MAX`
 [cast_precision_loss](https://github.com/Manishearth/rust-clippy/wiki#cast_precision_loss)                     | allow   | casts that cause loss of precision, e.g `x as f32` where `x: u64`
 [cast_sign_loss](https://github.com/Manishearth/rust-clippy/wiki#cast_sign_loss)                               | allow   | casts from signed types to unsigned types, e.g `x as u32` where `x: i32`
+[char_lit_as_u8](https://github.com/Manishearth/rust-clippy/wiki#char_lit_as_u8)                               | warn    | Casting a character literal to u8
 [chars_next_cmp](https://github.com/Manishearth/rust-clippy/wiki#chars_next_cmp)                               | warn    | using `.chars().next()` to check if a string starts with a char
 [cmp_nan](https://github.com/Manishearth/rust-clippy/wiki#cmp_nan)                                             | deny    | comparisons to NAN (which will always return false, which is probably not intended)
 [cmp_owned](https://github.com/Manishearth/rust-clippy/wiki#cmp_owned)                                         | warn    | creating owned instances for comparing with others, e.g. `x == "foo".to_string()`
index 731778db606212c09ef04c75f22a1052f3ccdda5..b0cf4d469723ac01a364a78ab0f8c1578d70b2de 100644 (file)
@@ -239,6 +239,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
         temporary_assignment::TEMPORARY_ASSIGNMENT,
         transmute::USELESS_TRANSMUTE,
         types::BOX_VEC,
+        types::CHAR_LIT_AS_U8,
         types::LET_UNIT_VALUE,
         types::LINKEDLIST,
         types::TYPE_COMPLEXITY,
index 94b2a3a57ba613fb311cc575ec87b667a8e9aae2..6a59abcdc15a623fbfe9a66093f384faca1b1749 100755 (executable)
@@ -9,7 +9,7 @@ import sys
 
 declare_lint_re = re.compile(r'''
     declare_lint! \s* [{(] \s*
-    pub \s+ (?P<name>[A-Z_]+) \s*,\s*
+    pub \s+ (?P<name>[A-Z_][A-Z_0-9]*) \s*,\s*
     (?P<level>Forbid|Deny|Warn|Allow) \s*,\s*
     " (?P<desc>(?:[^"\\]+|\\.)*) " \s* [})]
 ''', re.X | re.S)