mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
16 lines
209 B
Rust
16 lines
209 B
Rust
//@ 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() {}
|