mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
13 lines
231 B
Rust
13 lines
231 B
Rust
|
#![allow(incomplete_features)]
|
||
|
#![feature(generic_const_exprs)]
|
||
|
#![warn(clippy::branches_sharing_code)]
|
||
|
|
||
|
const fn f() -> usize {
|
||
|
2
|
||
|
}
|
||
|
const C: [f64; f()] = [0f64; f()];
|
||
|
|
||
|
fn main() {
|
||
|
let _ = if true { C[0] } else { C[1] };
|
||
|
}
|