We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c67e55 commit 17f4c2aCopy full SHA for 17f4c2a
src/test/codegen/vec-in-place.rs
@@ -0,0 +1,13 @@
1
+// compile-flags: -O
2
+// min-llvm-version: 11.0
3
+#![crate_type = "lib"]
4
+
5
+// Ensure that trivial casts of vec elements are O(1)
6
7
+// CHECK-LABEL: @vec_iterator_cast
8
+#[no_mangle]
9
+pub fn vec_iterator_cast(vec: Vec<isize>) -> Vec<usize> {
10
+ // CHECK-NOT: loop
11
+ // CHECK-NOT: call
12
+ vec.into_iter().map(|e| e as usize).collect()
13
+}
0 commit comments