@@ -1107,13 +1107,23 @@ fn link_natively(
11071107 let stripcmd = "rust-objcopy" ;
11081108 match ( strip, crate_type) {
11091109 ( Strip :: Debuginfo , _) => {
1110- let strip_options = vec ! [ "-S" . to_string( ) ] ;
1111- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1110+ let strip_options = vec ! [ "-S" ] ;
1111+ strip_symbols_with_external_utility (
1112+ sess,
1113+ stripcmd,
1114+ out_filename,
1115+ Some ( & strip_options) ,
1116+ )
11121117 }
11131118 // Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
11141119 ( Strip :: Symbols , CrateType :: Dylib | CrateType :: Cdylib | CrateType :: ProcMacro ) => {
1115- let strip_options = vec ! [ "-x" . to_string( ) ] ;
1116- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1120+ let strip_options = vec ! [ "-x" ] ;
1121+ strip_symbols_with_external_utility (
1122+ sess,
1123+ stripcmd,
1124+ out_filename,
1125+ Some ( & strip_options) ,
1126+ )
11171127 }
11181128 ( Strip :: Symbols , _) => {
11191129 strip_symbols_with_external_utility ( sess, stripcmd, out_filename, None )
@@ -1133,8 +1143,13 @@ fn link_natively(
11331143 match strip {
11341144 // Always preserve the symbol table (-x).
11351145 Strip :: Debuginfo => {
1136- let strip_options = vec ! [ "-x" . to_string( ) ] ;
1137- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1146+ let strip_options = vec ! [ "-x" ] ;
1147+ strip_symbols_with_external_utility (
1148+ sess,
1149+ stripcmd,
1150+ out_filename,
1151+ Some ( & strip_options) ,
1152+ )
11381153 }
11391154 // Strip::Symbols is handled via the --strip-all linker option.
11401155 Strip :: Symbols => { }
@@ -1148,17 +1163,27 @@ fn link_natively(
11481163 sess. dcx ( ) . emit_warn ( errors:: AixStripNotUsed ) ;
11491164 }
11501165 let stripcmd = "/usr/bin/strip" ;
1151- let mut strip_options = vec ! [ "-X32_64" . to_string ( ) ] ;
1166+ let mut strip_options = vec ! [ "-X32_64" ] ;
11521167 match strip {
11531168 Strip :: Debuginfo => {
11541169 // FIXME: AIX's strip utility only offers option to strip line number information.
1155- strip_options. push ( "-l" . to_string ( ) ) ;
1156- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1170+ strip_options. push ( "-l" ) ;
1171+ strip_symbols_with_external_utility (
1172+ sess,
1173+ stripcmd,
1174+ out_filename,
1175+ Some ( & strip_options) ,
1176+ )
11571177 }
11581178 Strip :: Symbols => {
11591179 // Must be noted this option might remove symbol __aix_rust_metadata and thus removes .info section which contains metadata.
1160- strip_options. push ( "-r" . to_string ( ) ) ;
1161- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1180+ strip_options. push ( "-r" ) ;
1181+ strip_symbols_with_external_utility (
1182+ sess,
1183+ stripcmd,
1184+ out_filename,
1185+ Some ( & strip_options) ,
1186+ )
11621187 }
11631188 Strip :: None => { }
11641189 }
@@ -1171,7 +1196,7 @@ fn strip_symbols_with_external_utility(
11711196 sess : & Session ,
11721197 util : & str ,
11731198 out_filename : & Path ,
1174- options : Option < & [ String ] > ,
1199+ options : Option < & [ & str ] > ,
11751200) {
11761201 let mut cmd = Command :: new ( util) ;
11771202 if let Some ( opts) = options {
0 commit comments