@@ -2,7 +2,7 @@ use std::ffi::{OsStr, OsString};
22use std:: fs:: { self , File } ;
33use std:: io:: prelude:: * ;
44use std:: path:: { Path , PathBuf } ;
5- use std:: { env, io , iter, mem, str} ;
5+ use std:: { env, iter, mem, str} ;
66
77use find_msvc_tools;
88use rustc_hir:: attrs:: WindowsSubsystemKind ;
@@ -809,7 +809,7 @@ impl<'a> Linker for GccLinker<'a> {
809809
810810 if self . sess . target . is_like_darwin {
811811 // Write a plain, newline-separated list of symbols
812- let res: io :: Result < ( ) > = try {
812+ let res = try {
813813 let mut f = File :: create_buffered ( & path) ?;
814814 for ( sym, _) in symbols {
815815 debug ! ( " _{sym}" ) ;
@@ -821,7 +821,7 @@ impl<'a> Linker for GccLinker<'a> {
821821 }
822822 self . link_arg ( "-exported_symbols_list" ) . link_arg ( path) ;
823823 } else if self . sess . target . is_like_windows {
824- let res: io :: Result < ( ) > = try {
824+ let res = try {
825825 let mut f = File :: create_buffered ( & path) ?;
826826
827827 // .def file similar to MSVC one but without LIBRARY section
@@ -845,7 +845,7 @@ impl<'a> Linker for GccLinker<'a> {
845845 self . link_arg ( "--export" ) . link_arg ( sym) ;
846846 }
847847 } else if crate_type == CrateType :: Executable && !self . sess . target . is_like_solaris {
848- let res: io :: Result < ( ) > = try {
848+ let res = try {
849849 let mut f = File :: create_buffered ( & path) ?;
850850 writeln ! ( f, "{{" ) ?;
851851 for ( sym, _) in symbols {
@@ -860,7 +860,7 @@ impl<'a> Linker for GccLinker<'a> {
860860 self . link_arg ( "--dynamic-list" ) . link_arg ( path) ;
861861 } else {
862862 // Write an LD version script
863- let res: io :: Result < ( ) > = try {
863+ let res = try {
864864 let mut f = File :: create_buffered ( & path) ?;
865865 writeln ! ( f, "{{" ) ?;
866866 if !symbols. is_empty ( ) {
@@ -1139,7 +1139,7 @@ impl<'a> Linker for MsvcLinker<'a> {
11391139 }
11401140
11411141 let path = tmpdir. join ( "lib.def" ) ;
1142- let res: io :: Result < ( ) > = try {
1142+ let res = try {
11431143 let mut f = File :: create_buffered ( & path) ?;
11441144
11451145 // Start off with the standard module name header and then go
@@ -1735,7 +1735,7 @@ impl<'a> Linker for AixLinker<'a> {
17351735 symbols : & [ ( String , SymbolExportKind ) ] ,
17361736 ) {
17371737 let path = tmpdir. join ( "list.exp" ) ;
1738- let res: io :: Result < ( ) > = try {
1738+ let res = try {
17391739 let mut f = File :: create_buffered ( & path) ?;
17401740 // FIXME: use llvm-nm to generate export list.
17411741 for ( symbol, _) in symbols {
@@ -2135,7 +2135,7 @@ impl<'a> Linker for BpfLinker<'a> {
21352135 symbols : & [ ( String , SymbolExportKind ) ] ,
21362136 ) {
21372137 let path = tmpdir. join ( "symbols" ) ;
2138- let res: io :: Result < ( ) > = try {
2138+ let res = try {
21392139 let mut f = File :: create_buffered ( & path) ?;
21402140 for ( sym, _) in symbols {
21412141 writeln ! ( f, "{sym}" ) ?;
0 commit comments