File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ Each warning should contain a link for more information on what the warning
21
21
means and how to resolve it.
22
22
" ;
23
23
24
+ /// Current version of the on-disk format.
25
+ const ON_DISK_VERSION : u32 = 0 ;
26
+
24
27
/// The future incompatibility report, emitted by the compiler as a JSON message.
25
28
#[ derive( serde:: Deserialize ) ]
26
29
pub struct FutureIncompatReport {
@@ -80,7 +83,7 @@ struct OnDiskReport {
80
83
impl Default for OnDiskReports {
81
84
fn default ( ) -> OnDiskReports {
82
85
OnDiskReports {
83
- version : 0 ,
86
+ version : ON_DISK_VERSION ,
84
87
next_id : 1 ,
85
88
reports : Vec :: new ( ) ,
86
89
}
@@ -161,7 +164,7 @@ impl OnDiskReports {
161
164
. with_context ( || "failed to read report" ) ?;
162
165
let on_disk_reports: OnDiskReports =
163
166
serde_json:: from_str ( & file_contents) . with_context ( || "failed to load report" ) ?;
164
- if on_disk_reports. version != 0 {
167
+ if on_disk_reports. version != ON_DISK_VERSION {
165
168
bail ! ( "unable to read reports; reports were saved from a future version of Cargo" ) ;
166
169
}
167
170
Ok ( on_disk_reports)
You can’t perform that action at this time.
0 commit comments