summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/expr-field.rs
blob: 638fbf521c4510f3f8275713f9078bf7e3ee18e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// check-pass

pub struct A {
    pub x: u32,
}

#[deny(unused_comparisons)]
pub fn foo(y: u32) -> A {
    A {
        #[allow(unused_comparisons)]
        x: if y < 0 { 1 } else { 2 },
    }
}

fn main() {}