File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ session_feature_diagnostic_help =
25
25
add `#![feature({ $feature } )]` to the crate attributes to enable
26
26
27
27
session_feature_suggest_upgrade_compiler =
28
- this compiler is version { $version } built on { $date } , consider upgrading?
28
+ this compiler was built on { $date } ; consider upgrading if it is out of date
29
29
30
30
session_file_is_not_writeable = output file { $file } is not writeable -- check its permissions
31
31
Original file line number Diff line number Diff line change @@ -35,16 +35,14 @@ pub struct FeatureDiagnosticForIssue {
35
35
#[ derive( Subdiagnostic ) ]
36
36
#[ note( session_feature_suggest_upgrade_compiler) ]
37
37
pub struct SuggestUpgradeCompiler {
38
- version : & ' static str ,
39
38
date : & ' static str ,
40
39
}
41
40
42
41
impl SuggestUpgradeCompiler {
43
- pub fn new ( ) -> Self {
44
- let version = option_env ! ( "CFG_VERSION" ) . unwrap_or ( "unknown" ) ;
45
- let date = option_env ! ( "CFG_VER_DATE" ) . unwrap_or ( "unknown" ) ;
42
+ pub fn new ( ) -> Option < Self > {
43
+ let date = option_env ! ( "CFG_VER_DATE" ) ?;
46
44
47
- Self { version , date }
45
+ Some ( Self { date } )
48
46
}
49
47
}
50
48
Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ pub fn add_feature_diagnostics_for_issue(
186
186
err. subdiagnostic ( FeatureDiagnosticHelp { feature } ) ;
187
187
}
188
188
189
- err. subdiagnostic ( SuggestUpgradeCompiler :: new ( ) ) ;
189
+ if let Some ( suggestion) = SuggestUpgradeCompiler :: new ( ) {
190
+ err. subdiagnostic ( suggestion) ;
191
+ }
190
192
}
191
193
}
192
194
You can’t perform that action at this time.
0 commit comments