diff --git a/compiler/rustc_builtin_macros/src/autodiff.rs b/compiler/rustc_builtin_macros/src/autodiff.rs index ddc59bfe1414a..3d3b63ba48768 100644 --- a/compiler/rustc_builtin_macros/src/autodiff.rs +++ b/compiler/rustc_builtin_macros/src/autodiff.rs @@ -49,7 +49,7 @@ mod llvm_enzyme { match l.kind { ast::LitKind::Int(val, _) => { // get an Ident from a lit - return rustc_span::Ident::from_str(val.get().to_string().as_str()); + return rustc_span::Ident::from_str(&val.get().to_string()); } _ => {} } diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 808aaceab4d20..43529932ac740 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -216,7 +216,7 @@ pub(crate) unsafe fn create_module<'ll>( if target_data_layout != llvm_data_layout { tcx.dcx().emit_err(crate::errors::MismatchedDataLayout { - rustc_target: sess.opts.target_triple.to_string().as_str(), + rustc_target: &sess.opts.target_triple.to_string(), rustc_layout: target_data_layout.as_str(), llvm_target: sess.target.llvm_target.borrow(), llvm_layout: llvm_data_layout,