@@ -10,6 +10,13 @@ use crate::CargoResult;
1010use crate :: core:: compiler:: BuildRunner ;
1111use crate :: core:: compiler:: CompileKind ;
1212
13+ /// JSON Schema of the [`RustdocFingerprint`] file.
14+ #[ derive( Debug , Serialize , Deserialize ) ]
15+ struct RustdocFingerprintJson {
16+ /// `rustc -vV` verbose version output.
17+ pub rustc_vv : String ,
18+ }
19+
1320/// Structure used to deal with Rustdoc fingerprinting
1421///
1522/// This is important because the `.js`/`.html` & `.css` files
@@ -21,11 +28,8 @@ use crate::core::compiler::CompileKind;
2128/// We need to make sure that if there were any previous docs already compiled,
2229/// they were compiled with the same Rustc version that we're currently using.
2330/// Otherwise we must remove the `doc/` folder and compile again forcing a rebuild.
24- #[ derive( Debug , Serialize , Deserialize ) ]
25- pub struct RustdocFingerprint {
26- /// `rustc -vV` verbose version output.
27- pub rustc_vv : String ,
28- }
31+ #[ derive( Debug ) ]
32+ pub struct RustdocFingerprint { }
2933
3034impl RustdocFingerprint {
3135 /// Checks whether the latest version of rustc used to compile this workspace's docs
@@ -52,7 +56,7 @@ impl RustdocFingerprint {
5256 {
5357 return Ok ( ( ) ) ;
5458 }
55- let new_fingerprint = RustdocFingerprint {
59+ let new_fingerprint = RustdocFingerprintJson {
5660 rustc_vv : build_runner. bcx . rustc ( ) . verbose_version . clone ( ) ,
5761 } ;
5862
@@ -77,7 +81,7 @@ fn fingerprint_path(build_runner: &BuildRunner<'_, '_>, kind: CompileKind) -> Pa
7781/// Checks rustdoc fingerprint file for a given [`CompileKind`].
7882fn check_fingerprint (
7983 build_runner : & BuildRunner < ' _ , ' _ > ,
80- new_fingerprint : & RustdocFingerprint ,
84+ new_fingerprint : & RustdocFingerprintJson ,
8185 kind : CompileKind ,
8286) -> CargoResult < ( ) > {
8387 let fingerprint_path = fingerprint_path ( build_runner, kind) ;
@@ -94,7 +98,7 @@ fn check_fingerprint(
9498 return write_fingerprint ( ) ;
9599 } ;
96100
97- match serde_json:: from_str :: < RustdocFingerprint > ( & rustdoc_data) {
101+ match serde_json:: from_str :: < RustdocFingerprintJson > ( & rustdoc_data) {
98102 Ok ( on_disk_fingerprint) => {
99103 if on_disk_fingerprint. rustc_vv == new_fingerprint. rustc_vv {
100104 return Ok ( ( ) ) ;
0 commit comments