@@ -20,7 +20,6 @@ use middle::allocator::AllocatorKind;
20
20
use middle:: dependency_format;
21
21
use session:: search_paths:: PathKind ;
22
22
use session:: config:: { OutputType , Lto } ;
23
- use ty:: tls;
24
23
use util:: nodemap:: { FxHashMap , FxHashSet } ;
25
24
use util:: common:: { duration_to_secs_str, ErrorReported } ;
26
25
use util:: common:: ProfileQueriesMsg ;
@@ -49,7 +48,6 @@ use std;
49
48
use std:: cell:: { self , Cell , RefCell } ;
50
49
use std:: collections:: HashMap ;
51
50
use std:: env;
52
- use std:: fmt;
53
51
use std:: io:: Write ;
54
52
use std:: path:: { Path , PathBuf } ;
55
53
use std:: time:: Duration ;
@@ -1301,39 +1299,3 @@ pub fn compile_result_from_err_count(err_count: usize) -> CompileResult {
1301
1299
Err ( CompileIncomplete :: Errored ( ErrorReported ) )
1302
1300
}
1303
1301
}
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