Files
rust/src/test/codegen/vec-in-place.rs

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

14 lines
357 B
Rust
Raw Normal View History

// ignore-debug: the debug assertions get in the way
2020-12-09 01:08:11 +01:00
// compile-flags: -O
#![crate_type = "lib"]
// Ensure that trivial casts of vec elements are O(1)
// CHECK-LABEL: @vec_iterator_cast
#[no_mangle]
pub fn vec_iterator_cast(vec: Vec<isize>) -> Vec<usize> {
// CHECK-NOT: loop
// CHECK-NOT: call
vec.into_iter().map(|e| e as usize).collect()
}