Skip to content

Commit 9f9473f

Browse files
committed
Allow specialization feature when documenting Cargo
1 parent b5f2a71 commit 9f9473f

File tree

1 file changed

+16
-4
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+16
-4
lines changed

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,9 +965,11 @@ macro_rules! tool_doc {
965965
(
966966
$tool: ident,
967967
$path: literal,
968-
mode = $mode:expr,
969-
$(is_library = $is_library:expr,)?
970-
$(crates = $crates:expr)?
968+
mode = $mode:expr
969+
$(, is_library = $is_library:expr )?
970+
$(, crates = $crates:expr )?
971+
// Subset of nightly features that are allowed to be used when documenting
972+
$(, allow_features: $allow_features:expr )?
971973
) => {
972974
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
973975
pub struct $tool {
@@ -1041,6 +1043,15 @@ macro_rules! tool_doc {
10411043
source_type,
10421044
&[],
10431045
);
1046+
let allow_features = {
1047+
let mut _value = "";
1048+
$( _value = $allow_features; )?
1049+
_value
1050+
};
1051+
1052+
if allow_features.is_empty() {
1053+
cargo.allow_features(allow_features);
1054+
}
10441055

10451056
cargo.arg("-Zskip-rustdoc-fingerprint");
10461057
// Only include compiler crates, no dependencies of those, such as `libc`.
@@ -1134,7 +1145,8 @@ tool_doc!(
11341145
"crates-io",
11351146
"mdman",
11361147
"rustfix",
1137-
]
1148+
],
1149+
allow_features: "specialization"
11381150
);
11391151
tool_doc!(Tidy, "src/tools/tidy", mode = Mode::ToolBootstrap, crates = ["tidy"]);
11401152
tool_doc!(

0 commit comments

Comments
 (0)