@@ -365,12 +365,6 @@ impl Session {
365
365
pub fn span_note_without_error < S : Into < MultiSpan > > ( & self , sp : S , msg : & str ) {
366
366
self . diagnostic ( ) . span_note_without_error ( sp, msg)
367
367
}
368
- pub fn span_unimpl < S : Into < MultiSpan > > ( & self , sp : S , msg : & str ) -> ! {
369
- self . diagnostic ( ) . span_unimpl ( sp, msg)
370
- }
371
- pub fn unimpl ( & self , msg : & str ) -> ! {
372
- self . diagnostic ( ) . unimpl ( msg)
373
- }
374
368
375
369
pub fn buffer_lint < S : Into < MultiSpan > > (
376
370
& self ,
@@ -1040,6 +1034,7 @@ fn default_emitter(
1040
1034
source_map : & Lrc < source_map:: SourceMap > ,
1041
1035
emitter_dest : Option < Box < dyn Write + Send > > ,
1042
1036
) -> Box < dyn Emitter + sync:: Send > {
1037
+ let external_macro_backtrace = sopts. debugging_opts . external_macro_backtrace ;
1043
1038
match ( sopts. error_format , emitter_dest) {
1044
1039
( config:: ErrorOutputType :: HumanReadable ( kind) , dst) => {
1045
1040
let ( short, color_config) = kind. unzip ( ) ;
@@ -1048,6 +1043,7 @@ fn default_emitter(
1048
1043
let emitter = AnnotateSnippetEmitterWriter :: new (
1049
1044
Some ( source_map. clone ( ) ) ,
1050
1045
short,
1046
+ external_macro_backtrace,
1051
1047
) ;
1052
1048
Box :: new ( emitter. ui_testing ( sopts. debugging_opts . ui_testing ) )
1053
1049
} else {
@@ -1058,6 +1054,7 @@ fn default_emitter(
1058
1054
short,
1059
1055
sopts. debugging_opts . teach ,
1060
1056
sopts. debugging_opts . terminal_width ,
1057
+ external_macro_backtrace,
1061
1058
) ,
1062
1059
Some ( dst) => EmitterWriter :: new (
1063
1060
dst,
@@ -1066,6 +1063,7 @@ fn default_emitter(
1066
1063
false , // no teach messages when writing to a buffer
1067
1064
false , // no colors when writing to a buffer
1068
1065
None , // no terminal width
1066
+ external_macro_backtrace,
1069
1067
) ,
1070
1068
} ;
1071
1069
Box :: new ( emitter. ui_testing ( sopts. debugging_opts . ui_testing ) )
@@ -1077,6 +1075,7 @@ fn default_emitter(
1077
1075
source_map. clone ( ) ,
1078
1076
pretty,
1079
1077
json_rendered,
1078
+ external_macro_backtrace,
1080
1079
) . ui_testing ( sopts. debugging_opts . ui_testing ) ,
1081
1080
) ,
1082
1081
( config:: ErrorOutputType :: Json { pretty, json_rendered } , Some ( dst) ) => Box :: new (
@@ -1086,6 +1085,7 @@ fn default_emitter(
1086
1085
source_map. clone ( ) ,
1087
1086
pretty,
1088
1087
json_rendered,
1088
+ external_macro_backtrace,
1089
1089
) . ui_testing ( sopts. debugging_opts . ui_testing ) ,
1090
1090
) ,
1091
1091
}
@@ -1382,27 +1382,27 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
1382
1382
let emitter: Box < dyn Emitter + sync:: Send > = match output {
1383
1383
config:: ErrorOutputType :: HumanReadable ( kind) => {
1384
1384
let ( short, color_config) = kind. unzip ( ) ;
1385
- Box :: new ( EmitterWriter :: stderr ( color_config, None , short, false , None ) )
1385
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , short, false , None , false ) )
1386
1386
}
1387
1387
config:: ErrorOutputType :: Json { pretty, json_rendered } =>
1388
- Box :: new ( JsonEmitter :: basic ( pretty, json_rendered) ) ,
1388
+ Box :: new ( JsonEmitter :: basic ( pretty, json_rendered, false ) ) ,
1389
1389
} ;
1390
1390
let handler = errors:: Handler :: with_emitter ( true , None , emitter) ;
1391
- handler. emit ( & MultiSpan :: new ( ) , msg, errors :: Level :: Fatal ) ;
1391
+ handler. struct_fatal ( msg) . emit ( ) ;
1392
1392
errors:: FatalError . raise ( ) ;
1393
1393
}
1394
1394
1395
1395
pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
1396
1396
let emitter: Box < dyn Emitter + sync:: Send > = match output {
1397
1397
config:: ErrorOutputType :: HumanReadable ( kind) => {
1398
1398
let ( short, color_config) = kind. unzip ( ) ;
1399
- Box :: new ( EmitterWriter :: stderr ( color_config, None , short, false , None ) )
1399
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , short, false , None , false ) )
1400
1400
}
1401
1401
config:: ErrorOutputType :: Json { pretty, json_rendered } =>
1402
- Box :: new ( JsonEmitter :: basic ( pretty, json_rendered) ) ,
1402
+ Box :: new ( JsonEmitter :: basic ( pretty, json_rendered, false ) ) ,
1403
1403
} ;
1404
1404
let handler = errors:: Handler :: with_emitter ( true , None , emitter) ;
1405
- handler. emit ( & MultiSpan :: new ( ) , msg, errors :: Level :: Warning ) ;
1405
+ handler. struct_warn ( msg) . emit ( ) ;
1406
1406
}
1407
1407
1408
1408
pub type CompileResult = Result < ( ) , ErrorReported > ;
0 commit comments