@@ -20,7 +20,6 @@ use middle::allocator::AllocatorKind;
2020use middle:: dependency_format;
2121use session:: search_paths:: PathKind ;
2222use session:: config:: { OutputType , Lto } ;
23- use ty:: tls;
2423use util:: nodemap:: { FxHashMap , FxHashSet } ;
2524use util:: common:: { duration_to_secs_str, ErrorReported } ;
2625use util:: common:: ProfileQueriesMsg ;
@@ -49,7 +48,6 @@ use std;
4948use std:: cell:: { self , Cell , RefCell } ;
5049use std:: collections:: HashMap ;
5150use std:: env;
52- use std:: fmt;
5351use std:: io:: Write ;
5452use std:: path:: { Path , PathBuf } ;
5553use std:: time:: Duration ;
@@ -1301,39 +1299,3 @@ pub fn compile_result_from_err_count(err_count: usize) -> CompileResult {
13011299 Err ( CompileIncomplete :: Errored ( ErrorReported ) )
13021300 }
13031301}
1304-
1305- #[ cold]
1306- #[ inline( never) ]
1307- pub fn bug_fmt ( file : & ' static str , line : u32 , args : fmt:: Arguments ) -> ! {
1308- // this wrapper mostly exists so I don't have to write a fully
1309- // qualified path of None::<Span> inside the bug!() macro definition
1310- opt_span_bug_fmt ( file, line, None :: < Span > , args) ;
1311- }
1312-
1313- #[ cold]
1314- #[ inline( never) ]
1315- pub fn span_bug_fmt < S : Into < MultiSpan > > (
1316- file : & ' static str ,
1317- line : u32 ,
1318- span : S ,
1319- args : fmt:: Arguments ,
1320- ) -> ! {
1321- opt_span_bug_fmt ( file, line, Some ( span) , args) ;
1322- }
1323-
1324- fn opt_span_bug_fmt < S : Into < MultiSpan > > (
1325- file : & ' static str ,
1326- line : u32 ,
1327- span : Option < S > ,
1328- args : fmt:: Arguments ,
1329- ) -> ! {
1330- tls:: with_opt ( move |tcx| {
1331- let msg = format ! ( "{}:{}: {}" , file, line, args) ;
1332- match ( tcx, span) {
1333- ( Some ( tcx) , Some ( span) ) => tcx. sess . diagnostic ( ) . span_bug ( span, & msg) ,
1334- ( Some ( tcx) , None ) => tcx. sess . diagnostic ( ) . bug ( & msg) ,
1335- ( None , _) => panic ! ( msg) ,
1336- }
1337- } ) ;
1338- unreachable ! ( ) ;
1339- }
0 commit comments