mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 01:11:21 -06:00
8 lines
180 B
Rust
8 lines
180 B
Rust
#[allow(unstable)]
|
|
pub fn sum_array(x: &[i32]) -> i32 {
|
|
unsafe {
|
|
std::intrinsics::assume(x.as_ptr() as usize % 64 == 0);
|
|
}
|
|
x.iter().fold(0, |sum, next| sum + *next)
|
|
}
|