@@ -296,7 +296,7 @@ fn fat_lto(cgcx: &CodegenContext,
296
296
let data = bc_decoded. data ( ) ;
297
297
linker. add ( & data) . map_err ( |( ) | {
298
298
let msg = format ! ( "failed to load bc of {:?}" , name) ;
299
- write:: llvm_err ( & diag_handler, msg)
299
+ write:: llvm_err ( & diag_handler, & msg)
300
300
} )
301
301
} ) ?;
302
302
timeline. record ( & format ! ( "link {:?}" , name) ) ;
@@ -490,7 +490,7 @@ fn thin_lto(cgcx: &CodegenContext,
490
490
symbol_white_list. as_ptr ( ) ,
491
491
symbol_white_list. len ( ) as u32 ,
492
492
) . 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" )
494
494
} ) ?;
495
495
496
496
info ! ( "thin LTO data created" ) ;
@@ -746,7 +746,7 @@ impl ThinModule {
746
746
{
747
747
let diag_handler = cgcx. create_diag_handler ( ) ;
748
748
let tm = ( cgcx. tm_factory ) ( ) . map_err ( |e| {
749
- write:: llvm_err ( & diag_handler, e)
749
+ write:: llvm_err ( & diag_handler, & e)
750
750
} ) ?;
751
751
752
752
// Right now the implementation we've got only works over serialized
@@ -761,7 +761,7 @@ impl ThinModule {
761
761
self . data ( ) . len ( ) ,
762
762
self . shared . module_names [ self . idx ] . as_ptr ( ) ,
763
763
) . 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" ;
765
765
write:: llvm_err ( & diag_handler, msg)
766
766
} ) ? as * const _ ;
767
767
let module = ModuleCodegen {
@@ -785,7 +785,7 @@ impl ThinModule {
785
785
let mut cu2 = ptr:: null_mut ( ) ;
786
786
llvm:: LLVMRustThinLTOGetDICompileUnit ( llmod, & mut cu1, & mut cu2) ;
787
787
if !cu2. is_null ( ) {
788
- let msg = "multiple source DICompileUnits found" . to_string ( ) ;
788
+ let msg = "multiple source DICompileUnits found" ;
789
789
return Err ( write:: llvm_err ( & diag_handler, msg) )
790
790
}
791
791
@@ -806,25 +806,25 @@ impl ThinModule {
806
806
// You can find some more comments about these functions in the LLVM
807
807
// bindings we've got (currently `PassWrapper.cpp`)
808
808
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" ;
810
810
return Err ( write:: llvm_err ( & diag_handler, msg) )
811
811
}
812
812
cgcx. save_temp_bitcode ( & module, "thin-lto-after-rename" ) ;
813
813
timeline. record ( "rename" ) ;
814
814
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" ;
816
816
return Err ( write:: llvm_err ( & diag_handler, msg) )
817
817
}
818
818
cgcx. save_temp_bitcode ( & module, "thin-lto-after-resolve" ) ;
819
819
timeline. record ( "resolve" ) ;
820
820
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" ;
822
822
return Err ( write:: llvm_err ( & diag_handler, msg) )
823
823
}
824
824
cgcx. save_temp_bitcode ( & module, "thin-lto-after-internalize" ) ;
825
825
timeline. record ( "internalize" ) ;
826
826
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" ;
828
828
return Err ( write:: llvm_err ( & diag_handler, msg) )
829
829
}
830
830
cgcx. save_temp_bitcode ( & module, "thin-lto-after-import" ) ;
0 commit comments