@@ -168,11 +168,11 @@ pub struct CodegenResults {
168168 pub crate_info : CrateInfo ,
169169}
170170
171- pub enum CodegenErrors {
171+ pub enum CodegenErrors < ' a > {
172172 WrongFileType ,
173173 EmptyVersionNumber ,
174- EncodingVersionMismatch { version_array : String , rlink_version : String } ,
175- RustcVersionMismatch { rustc_version : String , current_version : String } ,
174+ EncodingVersionMismatch { version_array : String , rlink_version : u32 } ,
175+ RustcVersionMismatch { rustc_version : String , current_version : & ' a str } ,
176176}
177177
178178pub fn provide ( providers : & mut Providers ) {
@@ -219,7 +219,7 @@ impl CodegenResults {
219219 encoder. finish ( )
220220 }
221221
222- pub fn deserialize_rlink ( data : Vec < u8 > ) -> Result < Self , CodegenErrors > {
222+ pub fn deserialize_rlink < ' a > ( data : Vec < u8 > ) -> Result < Self , CodegenErrors < ' a > > {
223223 // The Decodable machinery is not used here because it panics if the input data is invalid
224224 // and because its internal representation may change.
225225 if !data. starts_with ( RLINK_MAGIC ) {
@@ -235,7 +235,7 @@ impl CodegenResults {
235235 if u32:: from_be_bytes ( version_array) != RLINK_VERSION {
236236 return Err ( CodegenErrors :: EncodingVersionMismatch {
237237 version_array : String :: from_utf8_lossy ( & version_array) . to_string ( ) ,
238- rlink_version : RLINK_VERSION . to_string ( ) ,
238+ rlink_version : RLINK_VERSION ,
239239 } ) ;
240240 }
241241
@@ -245,7 +245,7 @@ impl CodegenResults {
245245 if rustc_version != current_version {
246246 return Err ( CodegenErrors :: RustcVersionMismatch {
247247 rustc_version : rustc_version. to_string ( ) ,
248- current_version : current_version . to_string ( ) ,
248+ current_version,
249249 } ) ;
250250 }
251251
0 commit comments