rust/tests/ui/lint/expr-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
209 B
Rust
Raw Normal View History

2023-09-13 14:44:47 -05:00
//@ 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() {}