File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 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
2121means and how to resolve it.
2222" ;
2323
24+ /// Current version of the on-disk format.
25+ const ON_DISK_VERSION : u32 = 0 ;
26+
2427/// The future incompatibility report, emitted by the compiler as a JSON message.
2528#[ derive( serde:: Deserialize ) ]
2629pub struct FutureIncompatReport {
@@ -80,7 +83,7 @@ struct OnDiskReport {
8083impl Default for OnDiskReports {
8184 fn default ( ) -> OnDiskReports {
8285 OnDiskReports {
83- version : 0 ,
86+ version : ON_DISK_VERSION ,
8487 next_id : 1 ,
8588 reports : Vec :: new ( ) ,
8689 }
@@ -161,7 +164,7 @@ impl OnDiskReports {
161164 . with_context ( || "failed to read report" ) ?;
162165 let on_disk_reports: OnDiskReports =
163166 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 {
165168 bail ! ( "unable to read reports; reports were saved from a future version of Cargo" ) ;
166169 }
167170 Ok ( on_disk_reports)
You can’t perform that action at this time.
0 commit comments