about summary refs log tree commit diff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2021-03-02 03:07:13 +0100
committerest31 <MTest31@outlook.com>2021-03-08 08:18:50 +0100
commitd018ef180d9bc4e852457fd83fda0bec8452baf6 (patch)
tree877780a5e90473836d289ecb69f9d2f5a7101286
parentd8c9a287036f72bf078f868f8fe635b7a7fde32c (diff)
downloadrust-d018ef180d9bc4e852457fd83fda0bec8452baf6.tar.gz
rust-d018ef180d9bc4e852457fd83fda0bec8452baf6.zip
Add notes to keep the UnusedExterns structs synced up
-rw-r--r--compiler/rustc_errors/src/json.rs4
-rw-r--r--src/librustdoc/doctest.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index 8511b51e3bf..3753ca580e7 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -335,6 +335,10 @@ struct FutureIncompatReport {
     future_incompat_report: Vec<FutureBreakageItem>,
 }
 
+// NOTE: Keep this in sync with the equivalent structs in rustdoc's
+// doctest component (as well as cargo).
+// We could unify this struct the one in rustdoc but they have different
+// ownership semantics, so doing so would create wasteful allocations.
 #[derive(Encodable)]
 struct UnusedExterns<'a, 'b, 'c> {
     /// The severity level of the unused dependencies lint
diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs
index 116b3aad61e..f7a6ccfc7d1 100644
--- a/src/librustdoc/doctest.rs
+++ b/src/librustdoc/doctest.rs
@@ -278,6 +278,10 @@ impl DirState {
     }
 }
 
+// NOTE: Keep this in sync with the equivalent structs in rustc
+// and cargo.
+// We could unify this struct the one in rustc but they have different
+// ownership semantics, so doing so would create wasteful allocations.
 #[derive(serde::Serialize, serde::Deserialize)]
 struct UnusedExterns {
     /// Lint level of the unused_crate_dependencies lint