mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
f9edd864df
Co-authored-by: Nikita Popov <github@npopov.com>
15 lines
270 B
Rust
15 lines
270 B
Rust
//@ compile-flags: -O
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
const N: usize = 3;
|
|
pub type T = u8;
|
|
|
|
// CHECK-LABEL: @split_multiple
|
|
// CHECK-NOT: unreachable
|
|
#[no_mangle]
|
|
pub fn split_multiple(slice: &[T]) -> (&[T], &[T]) {
|
|
let len = slice.len() / N;
|
|
slice.split_at(len * N)
|
|
}
|