<commit_before>#![feature(plugin)]
#![plugin(clippy)]

const ONE : i64 = 1;
const NEG_ONE : i64 = -1;
const ZERO : i64 = 0;

#[deny(identity_op)]
fn main() {
    let x = 0;

    x + 0;        //~ERROR the operation is ineffective
    0 + x;        //~ERROR the operation is ineffective
    x - ZERO;     //no error, as we skip lookups (for now)
    x | (0);      //~ERROR the operation is ineffective
    ((ZERO)) | x; //no error, as we skip lookups (for now)

    x * 1;        //~ERROR the operation is ineffective
    1 * x;        //~ERROR the operation is ineffective
    x / ONE;      //no error, as we skip lookups (for now)

    x & NEG_ONE;  //no error, as we skip lookups (for now)
    -1 & x;       //~ERROR the operation is ineffective
}<commit_msg>added regression test for #189<commit_after>#![feature(plugin)]
#![plugin(clippy)]

const ONE : i64 = 1;
const NEG_ONE : i64 = -1;
const ZERO : i64 = 0;

#[deny(identity_op)]
fn main() {
    let x = 0;

    x + 0;        //~ERROR the operation is ineffective
    x + (1 - 1);  //~ERROR the operation is ineffective
    x + 1;
    0 + x;        //~ERROR the operation is ineffective
    1 + x;
    x - ZERO;     //no error, as we skip lookups (for now)
    x | (0);      //~ERROR the operation is ineffective
    ((ZERO)) | x; //no error, as we skip lookups (for now)

    x * 1;        //~ERROR the operation is ineffective
    1 * x;        //~ERROR the operation is ineffective
    x / ONE;      //no error, as we skip lookups (for now)

    x / 2;        //no false positive

    x & NEG_ONE;  //no error, as we skip lookups (for now)
    -1 & x;       //~ERROR the operation is ineffective
}
{'fraction_non_alphanumeric': 0.1322463768115942, 'fraction_numerical': 0.024154589371980676, 'mean_word_length': 2.0571955719557193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3378078', 'n_tokens_mistral': 588, 'n_tokens_neox': 548, 'n_words': 225}