@@ -71,6 +71,17 @@ pub struct UnitInner {
71
71
/// [`BuildContext::extra_args_for`]: crate::core::compiler::build_context::BuildContext::extra_args_for
72
72
/// [`TargetInfo.rustflags`]: crate::core::compiler::build_context::TargetInfo::rustflags
73
73
pub rustflags : Arc < [ String ] > ,
74
+ /// Extra compiler flags to pass to `rustdoc` for a given unit.
75
+ ///
76
+ /// Although it depends on the caller, in the current Cargo implementation,
77
+ /// these flags take precedence over those from [`BuildContext::extra_args_for`].
78
+ ///
79
+ /// As of now, these flags come from environment variables and configurations.
80
+ /// See [`TargetInfo.rustdocflags`] for more on how Cargo collects them.
81
+ ///
82
+ /// [`BuildContext::extra_args_for`]: crate::core::compiler::build_context::BuildContext::extra_args_for
83
+ /// [`TargetInfo.rustdocflags`]: crate::core::compiler::build_context::TargetInfo::rustdocflags
84
+ pub rustdocflags : Arc < [ String ] > ,
74
85
// if `true`, the dependency is an artifact dependency, requiring special handling when
75
86
// calculating output directories, linkage and environment variables provided to builds.
76
87
pub artifact : IsArtifact ,
@@ -212,6 +223,7 @@ impl UnitInterner {
212
223
mode : CompileMode ,
213
224
features : Vec < InternedString > ,
214
225
rustflags : Arc < [ String ] > ,
226
+ rustdocflags : Arc < [ String ] > ,
215
227
is_std : bool ,
216
228
dep_hash : u64 ,
217
229
artifact : IsArtifact ,
@@ -246,6 +258,7 @@ impl UnitInterner {
246
258
mode,
247
259
features,
248
260
rustflags,
261
+ rustdocflags,
249
262
is_std,
250
263
dep_hash,
251
264
artifact,
0 commit comments