about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/inline_asm.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-25 18:57:56 +0200
committerGitHub <noreply@github.com>2024-07-25 18:57:56 +0200
commit155ba22f3cc7e2710cbac05eb2f844fbcc4dffd8 (patch)
treee463d2349381576d9d8e4cd81ec6aaf91b6287cd /compiler/rustc_codegen_cranelift/src/inline_asm.rs
parent54be9ad5eb47207d155904f6c912a9526133f75f (diff)
parentdb8cdc5d37da5c0cf306fba51d07d6af10d69bd7 (diff)
downloadrust-155ba22f3cc7e2710cbac05eb2f844fbcc4dffd8.tar.gz
rust-155ba22f3cc7e2710cbac05eb2f844fbcc4dffd8.zip
Rollup merge of #126908 - GnomedDev:cow-inline-asm-temp-piece, r=compiler-errors
Use Cow<'static, str> for InlineAsmTemplatePiece::String

This removes a bunch of `&'static str -> String` allocations in codegen cranelift.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/inline_asm.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/inline_asm.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
index c88230c9360..16edec47e10 100644
--- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs
+++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
@@ -46,9 +46,7 @@ pub(crate) fn codegen_inline_asm_terminator<'tcx>(
     // Used by panic_abort on Windows, but uses a syntax which only happens to work with
     // asm!() by accident and breaks with the GNU assembler as well as global_asm!() for
     // the LLVM backend.
-    if template.len() == 1
-        && template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string())
-    {
+    if template.len() == 1 && template[0] == InlineAsmTemplatePiece::String("int $$0x29".into()) {
         fx.bcx.ins().trap(TrapCode::User(1));
         return;
     }