Skip to content

Commit

Permalink
Fixing name of lint, adding test case
Browse files Browse the repository at this point in the history
  • Loading branch information
martiansideofthemoon committed Mar 6, 2016
1 parent 7fed35e commit f7f62a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/overflow_check_conditional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ use utils::{span_lint, span_help_and_lint, snippet, span_lint_and_then};
/// **Known problems:** None.
///
/// **Example:** `a + b < a`
declare_lint!(pub OVERFLOW_CHECK_CONDTIONAL, Warn,
declare_lint!(pub OVERFLOW_CHECK_CONDITIONAL, Warn,
"Using overflow checks which are likely to panic");

#[derive(Copy, Clone)]
pub struct OverflowCheckConditional;

impl LintPass for OverflowCheckConditional {
fn get_lints(&self) -> LintArray {
lint_array!(OVERFLOW_CHECK_CONDTIONAL)
lint_array!(OVERFLOW_CHECK_CONDITIONAL)
}
}

Expand Down
4 changes: 4 additions & 0 deletions tests/compile-fail/overflow_check_conditional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
fn main() {
let a: u32 = 1;
let b: u32 = 2;
let c: u32 = 3;
if a + b < a {

}
if a + b < c {

}
}

0 comments on commit f7f62a2

Please sign in to comment.