We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4773fbc commit c975e16Copy full SHA for c975e16
tests/codegen/issue-97217.rs
@@ -0,0 +1,21 @@
1
+// compile-flags: -C opt-level=3
2
+// ignore-debug: the debug assertions get in the way
3
+#![crate_type = "lib"]
4
+
5
+// Regression test for issue 97217 (the following should result in no allocations)
6
7
+// CHECK-LABEL: @issue97217
8
+#[no_mangle]
9
+pub fn issue97217() -> i32 {
10
+ // drop_in_place should be inlined and never appear
11
+ // CHECK-NOT: drop_in_place
12
13
+ // __rust_alloc should be optimized out
14
+ // CHECK-NOT: __rust_alloc
15
16
+ let v1 = vec![5, 6, 7];
17
+ let v1_iter = v1.iter();
18
+ let total: i32 = v1_iter.sum();
19
+ println!("{}",total);
20
+ total
21
+}
0 commit comments