about summary refs log tree commit diff
path: root/src/librustc/lint/builtin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc/lint/builtin.rs')
-rw-r--r--src/librustc/lint/builtin.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 44718d1c525..4f56f2441dc 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -100,6 +100,17 @@ declare_lint! {
     "detects transmutes of fat pointers"
 }
 
+declare_lint! {
+    pub TRIVIAL_CAST,
+    Warn,
+    "detects trivial casts which could be removed"
+}
+
+declare_lint! {
+    pub TRIVIAL_NUMERIC_CAST,
+    Warn,
+    "detects trivial casts of numeric types which could be removed"
+}
 /// Does nothing as a lint pass, but registers some `Lint`s
 /// which are used by other parts of the compiler.
 #[derive(Copy)]
@@ -121,7 +132,9 @@ impl LintPass for HardwiredLints {
             STABLE_FEATURES,
             UNKNOWN_CRATE_TYPES,
             VARIANT_SIZE_DIFFERENCES,
-            FAT_PTR_TRANSMUTES
+            FAT_PTR_TRANSMUTES,
+            TRIVIAL_CAST,
+            TRIVIAL_NUMERIC_CAST
         )
     }
 }