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