Skip to content

Commit 8e9c86c

Browse files
committed
Remove --crate-type test for rustdoc now that it is stable.
1 parent 5b20444 commit 8e9c86c

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use semver::Version;
99
use super::BuildContext;
1010
use crate::core::compiler::CompileKind;
1111
use crate::core::{Edition, InternedString, Package, PackageId, Target};
12-
use crate::util::{self, join_paths, process, rustc::Rustc, CargoResult, Config, ProcessBuilder};
12+
use crate::util::{self, join_paths, process, CargoResult, Config, ProcessBuilder};
1313

1414
pub struct Doctest {
1515
/// The package being doc-tested.
@@ -75,7 +75,6 @@ pub struct Compilation<'cfg> {
7575
primary_unit_rustc_process: Option<ProcessBuilder>,
7676

7777
target_runner: Option<(PathBuf, Vec<String>)>,
78-
supports_rustdoc_crate_type: bool,
7978
}
8079

8180
impl<'cfg> Compilation<'cfg> {
@@ -115,7 +114,6 @@ impl<'cfg> Compilation<'cfg> {
115114
host: bcx.host_triple().to_string(),
116115
target: default_kind.short_name(bcx).to_string(),
117116
target_runner: target_runner(bcx, default_kind)?,
118-
supports_rustdoc_crate_type: supports_rustdoc_crate_type(bcx.config, &bcx.rustc)?,
119117
})
120118
}
121119

@@ -148,10 +146,8 @@ impl<'cfg> Compilation<'cfg> {
148146
p.arg(format!("--edition={}", target.edition()));
149147
}
150148

151-
if self.supports_rustdoc_crate_type {
152-
for crate_type in target.rustc_crate_types() {
153-
p.arg("--crate-type").arg(crate_type);
154-
}
149+
for crate_type in target.rustc_crate_types() {
150+
p.arg("--crate-type").arg(crate_type);
155151
}
156152

157153
Ok(p)
@@ -331,14 +327,3 @@ fn target_runner(
331327

332328
Ok(None)
333329
}
334-
335-
fn supports_rustdoc_crate_type(config: &Config, rustc: &Rustc) -> CargoResult<bool> {
336-
// NOTE: Unconditionally return 'true' once support for
337-
// rustdoc '--crate-type' rides to stable
338-
let mut crate_type_test = process(config.rustdoc()?);
339-
// If '--crate-type' is not supported by rustcoc, this command
340-
// will exit with an error. Otherwise, it will print a help message,
341-
// and exit successfully
342-
crate_type_test.args(&["--crate-type", "proc-macro", "--help"]);
343-
Ok(rustc.cached_output(&crate_type_test).is_ok())
344-
}

0 commit comments

Comments
 (0)