@@ -4,7 +4,7 @@ use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LOCAL_CRATE, LocalDefId};
44use rustc_hir:: { ItemId , Node , find_attr} ;
55use rustc_middle:: query:: Providers ;
66use rustc_middle:: ty:: TyCtxt ;
7- use rustc_session:: config:: { CrateType , EntryFnType , sigpipe } ;
7+ use rustc_session:: config:: { CrateType , EntryFnType } ;
88use rustc_span:: { RemapPathScopeComponents , Span } ;
99
1010use crate :: errors:: { ExternMain , MultipleRustcMain , NoMainErr } ;
@@ -74,7 +74,7 @@ fn check_and_search_item(id: ItemId, ctxt: &mut EntryContext<'_>) {
7474fn configure_main ( tcx : TyCtxt < ' _ > , visitor : & EntryContext < ' _ > ) -> Option < ( DefId , EntryFnType ) > {
7575 if let Some ( ( local_def_id, _) ) = visitor. rustc_main_fn {
7676 let def_id = local_def_id. to_def_id ( ) ;
77- Some ( ( def_id, EntryFnType :: Main { sigpipe : sigpipe ( tcx ) } ) )
77+ Some ( ( def_id, EntryFnType :: Main ) )
7878 } else {
7979 // The actual resolution of main happens in the resolver, this here
8080 if let Some ( main_def) = tcx. resolutions ( ( ) ) . main_def
@@ -88,22 +88,13 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_>) -> Option<(DefId,
8888 return None ;
8989 }
9090
91- return Some ( ( def_id, EntryFnType :: Main { sigpipe : sigpipe ( tcx ) } ) ) ;
91+ return Some ( ( def_id, EntryFnType :: Main ) ) ;
9292 }
9393 no_main_err ( tcx, visitor) ;
9494 None
9595 }
9696}
9797
98- fn sigpipe ( tcx : TyCtxt < ' _ > ) -> u8 {
99- match tcx. sess . opts . unstable_opts . on_broken_pipe {
100- rustc_target:: spec:: OnBrokenPipe :: Default => sigpipe:: DEFAULT ,
101- rustc_target:: spec:: OnBrokenPipe :: Kill => sigpipe:: SIG_DFL ,
102- rustc_target:: spec:: OnBrokenPipe :: Error => sigpipe:: SIG_IGN ,
103- rustc_target:: spec:: OnBrokenPipe :: Inherit => sigpipe:: INHERIT ,
104- }
105- }
106-
10798fn no_main_err ( tcx : TyCtxt < ' _ > , visitor : & EntryContext < ' _ > ) {
10899 let sp = tcx. def_span ( CRATE_DEF_ID ) ;
109100
0 commit comments