@@ -9,7 +9,7 @@ use semver::Version;
9
9
use super :: BuildContext ;
10
10
use crate :: core:: compiler:: CompileKind ;
11
11
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 } ;
13
13
14
14
pub struct Doctest {
15
15
/// The package being doc-tested.
@@ -75,7 +75,6 @@ pub struct Compilation<'cfg> {
75
75
primary_unit_rustc_process : Option < ProcessBuilder > ,
76
76
77
77
target_runner : Option < ( PathBuf , Vec < String > ) > ,
78
- supports_rustdoc_crate_type : bool ,
79
78
}
80
79
81
80
impl < ' cfg > Compilation < ' cfg > {
@@ -115,7 +114,6 @@ impl<'cfg> Compilation<'cfg> {
115
114
host : bcx. host_triple ( ) . to_string ( ) ,
116
115
target : default_kind. short_name ( bcx) . to_string ( ) ,
117
116
target_runner : target_runner ( bcx, default_kind) ?,
118
- supports_rustdoc_crate_type : supports_rustdoc_crate_type ( bcx. config , & bcx. rustc ) ?,
119
117
} )
120
118
}
121
119
@@ -148,10 +146,8 @@ impl<'cfg> Compilation<'cfg> {
148
146
p. arg ( format ! ( "--edition={}" , target. edition( ) ) ) ;
149
147
}
150
148
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) ;
155
151
}
156
152
157
153
Ok ( p)
@@ -331,14 +327,3 @@ fn target_runner(
331
327
332
328
Ok ( None )
333
329
}
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