@@ -168,11 +168,11 @@ pub struct CodegenResults {
168
168
pub crate_info : CrateInfo ,
169
169
}
170
170
171
- pub enum CodegenErrors {
171
+ pub enum CodegenErrors < ' a > {
172
172
WrongFileType ,
173
173
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 } ,
176
176
}
177
177
178
178
pub fn provide ( providers : & mut Providers ) {
@@ -219,7 +219,7 @@ impl CodegenResults {
219
219
encoder. finish ( )
220
220
}
221
221
222
- pub fn deserialize_rlink ( data : Vec < u8 > ) -> Result < Self , CodegenErrors > {
222
+ pub fn deserialize_rlink < ' a > ( data : Vec < u8 > ) -> Result < Self , CodegenErrors < ' a > > {
223
223
// The Decodable machinery is not used here because it panics if the input data is invalid
224
224
// and because its internal representation may change.
225
225
if !data. starts_with ( RLINK_MAGIC ) {
@@ -235,7 +235,7 @@ impl CodegenResults {
235
235
if u32:: from_be_bytes ( version_array) != RLINK_VERSION {
236
236
return Err ( CodegenErrors :: EncodingVersionMismatch {
237
237
version_array : String :: from_utf8_lossy ( & version_array) . to_string ( ) ,
238
- rlink_version : RLINK_VERSION . to_string ( ) ,
238
+ rlink_version : RLINK_VERSION ,
239
239
} ) ;
240
240
}
241
241
@@ -245,7 +245,7 @@ impl CodegenResults {
245
245
if rustc_version != current_version {
246
246
return Err ( CodegenErrors :: RustcVersionMismatch {
247
247
rustc_version : rustc_version. to_string ( ) ,
248
- current_version : current_version . to_string ( ) ,
248
+ current_version,
249
249
} ) ;
250
250
}
251
251
0 commit comments