diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs index 1347fb862..3e50095a4 100644 --- a/src/cargo/core/compiler/compilation.rs +++ b/src/cargo/core/compiler/compilation.rs @@ -1,3 +1,5 @@ +//! Type definitions for the result of a compilation. + use std::collections::{BTreeSet, HashMap}; use std::env; use std::ffi::{OsStr, OsString}; diff --git a/src/cargo/core/compiler/compile_kind.rs b/src/cargo/core/compiler/compile_kind.rs index 7ab19ae1c..45a464684 100644 --- a/src/cargo/core/compiler/compile_kind.rs +++ b/src/cargo/core/compiler/compile_kind.rs @@ -1,3 +1,5 @@ +//! Type definitions for cross-compilation. + use crate::core::Target; use crate::util::errors::CargoResult; use crate::util::interning::InternedString; diff --git a/src/cargo/core/compiler/timings.rs b/src/cargo/core/compiler/timings.rs index 575f9a3d2..c44eebaec 100644 --- a/src/cargo/core/compiler/timings.rs +++ b/src/cargo/core/compiler/timings.rs @@ -16,6 +16,13 @@ use std::io::{BufWriter, Write}; use std::thread::available_parallelism; use std::time::{Duration, Instant, SystemTime}; +/// Tracking information for the entire build. +/// +/// Methods on this structure are generally called from the main thread of a +/// running [`JobQueue`] instance (`DrainState` in specific) when the queue +/// receives messages from spawned off threads. +/// +/// [`JobQueue`]: super::JobQueue pub struct Timings<'cfg> { config: &'cfg Config, /// Whether or not timings should be captured. @@ -253,12 +260,12 @@ impl<'cfg> Timings<'cfg> { self.concurrency.push(c); } - /// Mark that a fresh unit was encountered. + /// Mark that a fresh unit was encountered. (No re-compile needed) pub fn add_fresh(&mut self) { self.total_fresh += 1; } - /// Mark that a dirty unit was encountered. + /// Mark that a dirty unit was encountered. (Re-compile needed) pub fn add_dirty(&mut self) { self.total_dirty += 1; } @@ -456,6 +463,8 @@ impl<'cfg> Timings<'cfg> { Ok(()) } + /// Write timing data in JavaScript. Primarily for `timings.js` to put data + /// in a `