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.
memcpy
String::push
1 parent 7df40e7 commit 2cb20b3Copy full SHA for 2cb20b3
tests/codegen/string-push.rs
@@ -0,0 +1,11 @@
1
+//@ compile-flags: -O
2
+#![crate_type = "lib"]
3
+
4
+use std::hint::black_box;
5
6
+// CHECK-LABEL: @string_push_does_not_call_memcpy
7
+#[no_mangle]
8
+pub fn string_push_does_not_call_memcpy(s: &mut String, ch: char) {
9
+ // CHECK-NOT: call void @llvm.memcpy
10
+ s.push(ch);
11
+}
0 commit comments