@@ -20,7 +20,7 @@ use rustc_serialize::{
2020 opaque:: { FileEncoder , MemDecoder } ,
2121 Decodable , Encodable ,
2222} ;
23- use rustc_session:: { config :: CrateType , getopts} ;
23+ use rustc_session:: getopts;
2424use rustc_span:: {
2525 def_id:: { CrateNum , DefPathHash , LOCAL_CRATE } ,
2626 edition:: Edition ,
@@ -123,7 +123,7 @@ struct FindCalls<'a, 'tcx> {
123123 cx : Context < ' tcx > ,
124124 target_crates : Vec < CrateNum > ,
125125 calls : & ' a mut AllCallLocations ,
126- crate_types : Vec < CrateType > ,
126+ bin_crate : bool ,
127127}
128128
129129impl < ' a , ' tcx > Visitor < ' tcx > for FindCalls < ' a , ' tcx >
@@ -247,7 +247,7 @@ where
247247 let mk_call_data = || {
248248 let display_name = file_path. display ( ) . to_string ( ) ;
249249 let edition = call_span. edition ( ) ;
250- let is_bin = self . crate_types . contains ( & CrateType :: Executable ) ;
250+ let is_bin = self . bin_crate ;
251251
252252 CallData { locations : Vec :: new ( ) , url, display_name, edition, is_bin }
253253 } ;
@@ -278,7 +278,7 @@ pub(crate) fn run(
278278 cache : formats:: cache:: Cache ,
279279 tcx : TyCtxt < ' _ > ,
280280 options : ScrapeExamplesOptions ,
281- crate_types : Vec < CrateType > ,
281+ bin_crate : bool ,
282282) -> interface:: Result < ( ) > {
283283 let inner = move || -> Result < ( ) , String > {
284284 // Generates source files for examples
@@ -306,7 +306,7 @@ pub(crate) fn run(
306306 // Run call-finder on all items
307307 let mut calls = FxHashMap :: default ( ) ;
308308 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 } ;
310310 tcx. hir ( ) . visit_all_item_likes_in_crate ( & mut finder) ;
311311
312312 // The visitor might have found a type error, which we need to
0 commit comments