<commit_before>#![feature(plugin, never_type)]
#![plugin(clippy)]
#![deny(diverging_sub_expression)]

#[allow(empty_loop)]
fn diverge() -> ! { loop {} }

struct A;

impl A {
    fn foo(&self) -> ! { diverge() }
}

#[allow(unused_variables, unnecessary_operation)]
fn main() {
    let b = true;
    b || diverge(); //~ ERROR sub-expression diverges
    b || A.foo(); //~ ERROR sub-expression diverges
    let y = (5, diverge(), 6); //~ ERROR sub-expression diverges
    println!("{}", y.1);
}<commit_msg>also test match statements, return, continue and break<commit_after>#![feature(plugin, never_type)]
#![plugin(clippy)]
#![deny(diverging_sub_expression)]

#[allow(empty_loop)]
fn diverge() -> ! { loop {} }

struct A;

impl A {
    fn foo(&self) -> ! { diverge() }
}

#[allow(unused_variables, unnecessary_operation)]
fn main() {
    let b = true;
    b || diverge(); //~ ERROR sub-expression diverges
    b || A.foo(); //~ ERROR sub-expression diverges
    let y = (5, diverge(), 6); //~ ERROR sub-expression diverges
    println!("{}", y.1);
}

#[allow(dead_code, unused_variables)]
fn foobar() {
    loop {
        let x = match 5 {
            4 => return,
            5 => continue,
            6 => (println!("foo"), return), //~ ERROR sub-expression diverges
            7 => (println!("bar"), continue), //~ ERROR sub-expression diverges
            8 => break,
            9 => diverge(),
            3 => (println!("moo"), diverge()), //~ ERROR sub-expression diverges
            _ => (println!("boo"), break), //~ ERROR sub-expression diverges
        };
    }
}
{'fraction_non_alphanumeric': 0.18908629441624367, 'fraction_numerical': 0.008883248730964468, 'mean_word_length': 2.893827160493827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3426069', 'n_tokens_mistral': 509, 'n_tokens_neox': 514, 'n_words': 131}