@@ -20,7 +20,7 @@ use rustc_serialize::{
20
20
opaque:: { FileEncoder , MemDecoder } ,
21
21
Decodable , Encodable ,
22
22
} ;
23
- use rustc_session:: { config :: CrateType , getopts} ;
23
+ use rustc_session:: getopts;
24
24
use rustc_span:: {
25
25
def_id:: { CrateNum , DefPathHash , LOCAL_CRATE } ,
26
26
edition:: Edition ,
@@ -123,7 +123,7 @@ struct FindCalls<'a, 'tcx> {
123
123
cx : Context < ' tcx > ,
124
124
target_crates : Vec < CrateNum > ,
125
125
calls : & ' a mut AllCallLocations ,
126
- crate_types : Vec < CrateType > ,
126
+ bin_crate : bool ,
127
127
}
128
128
129
129
impl < ' a , ' tcx > Visitor < ' tcx > for FindCalls < ' a , ' tcx >
@@ -247,7 +247,7 @@ where
247
247
let mk_call_data = || {
248
248
let display_name = file_path. display ( ) . to_string ( ) ;
249
249
let edition = call_span. edition ( ) ;
250
- let is_bin = self . crate_types . contains ( & CrateType :: Executable ) ;
250
+ let is_bin = self . bin_crate ;
251
251
252
252
CallData { locations : Vec :: new ( ) , url, display_name, edition, is_bin }
253
253
} ;
@@ -278,7 +278,7 @@ pub(crate) fn run(
278
278
cache : formats:: cache:: Cache ,
279
279
tcx : TyCtxt < ' _ > ,
280
280
options : ScrapeExamplesOptions ,
281
- crate_types : Vec < CrateType > ,
281
+ bin_crate : bool ,
282
282
) -> interface:: Result < ( ) > {
283
283
let inner = move || -> Result < ( ) , String > {
284
284
// Generates source files for examples
@@ -306,7 +306,7 @@ pub(crate) fn run(
306
306
// Run call-finder on all items
307
307
let mut calls = FxHashMap :: default ( ) ;
308
308
let mut finder =
309
- FindCalls { calls : & mut calls, tcx, map : tcx. hir ( ) , cx, target_crates, crate_types } ;
309
+ FindCalls { calls : & mut calls, tcx, map : tcx. hir ( ) , cx, target_crates, bin_crate } ;
310
310
tcx. hir ( ) . visit_all_item_likes_in_crate ( & mut finder) ;
311
311
312
312
// The visitor might have found a type error, which we need to
0 commit comments