@@ -296,7 +296,7 @@ fn fat_lto(cgcx: &CodegenContext,
296296 let data = bc_decoded. data ( ) ;
297297 linker. add ( & data) . map_err ( |( ) | {
298298 let msg = format ! ( "failed to load bc of {:?}" , name) ;
299- write:: llvm_err ( & diag_handler, msg)
299+ write:: llvm_err ( & diag_handler, & msg)
300300 } )
301301 } ) ?;
302302 timeline. record ( & format ! ( "link {:?}" , name) ) ;
@@ -490,7 +490,7 @@ fn thin_lto(cgcx: &CodegenContext,
490490 symbol_white_list. as_ptr ( ) ,
491491 symbol_white_list. len ( ) as u32 ,
492492 ) . ok_or_else ( || {
493- write:: llvm_err ( & diag_handler, "failed to prepare thin LTO context" . to_string ( ) )
493+ write:: llvm_err ( & diag_handler, "failed to prepare thin LTO context" )
494494 } ) ?;
495495
496496 info ! ( "thin LTO data created" ) ;
@@ -746,7 +746,7 @@ impl ThinModule {
746746 {
747747 let diag_handler = cgcx. create_diag_handler ( ) ;
748748 let tm = ( cgcx. tm_factory ) ( ) . map_err ( |e| {
749- write:: llvm_err ( & diag_handler, e)
749+ write:: llvm_err ( & diag_handler, & e)
750750 } ) ?;
751751
752752 // Right now the implementation we've got only works over serialized
@@ -761,7 +761,7 @@ impl ThinModule {
761761 self . data ( ) . len ( ) ,
762762 self . shared . module_names [ self . idx ] . as_ptr ( ) ,
763763 ) . ok_or_else ( || {
764- let msg = "failed to parse bitcode for thin LTO module" . to_string ( ) ;
764+ let msg = "failed to parse bitcode for thin LTO module" ;
765765 write:: llvm_err ( & diag_handler, msg)
766766 } ) ? as * const _ ;
767767 let module = ModuleCodegen {
@@ -785,7 +785,7 @@ impl ThinModule {
785785 let mut cu2 = ptr:: null_mut ( ) ;
786786 llvm:: LLVMRustThinLTOGetDICompileUnit ( llmod, & mut cu1, & mut cu2) ;
787787 if !cu2. is_null ( ) {
788- let msg = "multiple source DICompileUnits found" . to_string ( ) ;
788+ let msg = "multiple source DICompileUnits found" ;
789789 return Err ( write:: llvm_err ( & diag_handler, msg) )
790790 }
791791
@@ -806,25 +806,25 @@ impl ThinModule {
806806 // You can find some more comments about these functions in the LLVM
807807 // bindings we've got (currently `PassWrapper.cpp`)
808808 if !llvm:: LLVMRustPrepareThinLTORename ( self . shared . data . 0 , llmod) {
809- let msg = "failed to prepare thin LTO module" . to_string ( ) ;
809+ let msg = "failed to prepare thin LTO module" ;
810810 return Err ( write:: llvm_err ( & diag_handler, msg) )
811811 }
812812 cgcx. save_temp_bitcode ( & module, "thin-lto-after-rename" ) ;
813813 timeline. record ( "rename" ) ;
814814 if !llvm:: LLVMRustPrepareThinLTOResolveWeak ( self . shared . data . 0 , llmod) {
815- let msg = "failed to prepare thin LTO module" . to_string ( ) ;
815+ let msg = "failed to prepare thin LTO module" ;
816816 return Err ( write:: llvm_err ( & diag_handler, msg) )
817817 }
818818 cgcx. save_temp_bitcode ( & module, "thin-lto-after-resolve" ) ;
819819 timeline. record ( "resolve" ) ;
820820 if !llvm:: LLVMRustPrepareThinLTOInternalize ( self . shared . data . 0 , llmod) {
821- let msg = "failed to prepare thin LTO module" . to_string ( ) ;
821+ let msg = "failed to prepare thin LTO module" ;
822822 return Err ( write:: llvm_err ( & diag_handler, msg) )
823823 }
824824 cgcx. save_temp_bitcode ( & module, "thin-lto-after-internalize" ) ;
825825 timeline. record ( "internalize" ) ;
826826 if !llvm:: LLVMRustPrepareThinLTOImport ( self . shared . data . 0 , llmod) {
827- let msg = "failed to prepare thin LTO module" . to_string ( ) ;
827+ let msg = "failed to prepare thin LTO module" ;
828828 return Err ( write:: llvm_err ( & diag_handler, msg) )
829829 }
830830 cgcx. save_temp_bitcode ( & module, "thin-lto-after-import" ) ;
0 commit comments