@@ -365,12 +365,6 @@ impl Session {
365365 pub fn span_note_without_error < S : Into < MultiSpan > > ( & self , sp : S , msg : & str ) {
366366 self . diagnostic ( ) . span_note_without_error ( sp, msg)
367367 }
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- }
374368
375369 pub fn buffer_lint < S : Into < MultiSpan > > (
376370 & self ,
@@ -1040,6 +1034,7 @@ fn default_emitter(
10401034 source_map : & Lrc < source_map:: SourceMap > ,
10411035 emitter_dest : Option < Box < dyn Write + Send > > ,
10421036) -> Box < dyn Emitter + sync:: Send > {
1037+ let external_macro_backtrace = sopts. debugging_opts . external_macro_backtrace ;
10431038 match ( sopts. error_format , emitter_dest) {
10441039 ( config:: ErrorOutputType :: HumanReadable ( kind) , dst) => {
10451040 let ( short, color_config) = kind. unzip ( ) ;
@@ -1048,6 +1043,7 @@ fn default_emitter(
10481043 let emitter = AnnotateSnippetEmitterWriter :: new (
10491044 Some ( source_map. clone ( ) ) ,
10501045 short,
1046+ external_macro_backtrace,
10511047 ) ;
10521048 Box :: new ( emitter. ui_testing ( sopts. debugging_opts . ui_testing ) )
10531049 } else {
@@ -1058,6 +1054,7 @@ fn default_emitter(
10581054 short,
10591055 sopts. debugging_opts . teach ,
10601056 sopts. debugging_opts . terminal_width ,
1057+ external_macro_backtrace,
10611058 ) ,
10621059 Some ( dst) => EmitterWriter :: new (
10631060 dst,
@@ -1066,6 +1063,7 @@ fn default_emitter(
10661063 false , // no teach messages when writing to a buffer
10671064 false , // no colors when writing to a buffer
10681065 None , // no terminal width
1066+ external_macro_backtrace,
10691067 ) ,
10701068 } ;
10711069 Box :: new ( emitter. ui_testing ( sopts. debugging_opts . ui_testing ) )
@@ -1077,6 +1075,7 @@ fn default_emitter(
10771075 source_map. clone ( ) ,
10781076 pretty,
10791077 json_rendered,
1078+ external_macro_backtrace,
10801079 ) . ui_testing ( sopts. debugging_opts . ui_testing ) ,
10811080 ) ,
10821081 ( config:: ErrorOutputType :: Json { pretty, json_rendered } , Some ( dst) ) => Box :: new (
@@ -1086,6 +1085,7 @@ fn default_emitter(
10861085 source_map. clone ( ) ,
10871086 pretty,
10881087 json_rendered,
1088+ external_macro_backtrace,
10891089 ) . ui_testing ( sopts. debugging_opts . ui_testing ) ,
10901090 ) ,
10911091 }
@@ -1382,27 +1382,27 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
13821382 let emitter: Box < dyn Emitter + sync:: Send > = match output {
13831383 config:: ErrorOutputType :: HumanReadable ( kind) => {
13841384 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 ) )
13861386 }
13871387 config:: ErrorOutputType :: Json { pretty, json_rendered } =>
1388- Box :: new ( JsonEmitter :: basic ( pretty, json_rendered) ) ,
1388+ Box :: new ( JsonEmitter :: basic ( pretty, json_rendered, false ) ) ,
13891389 } ;
13901390 let handler = errors:: Handler :: with_emitter ( true , None , emitter) ;
1391- handler. emit ( & MultiSpan :: new ( ) , msg, errors :: Level :: Fatal ) ;
1391+ handler. struct_fatal ( msg) . emit ( ) ;
13921392 errors:: FatalError . raise ( ) ;
13931393}
13941394
13951395pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
13961396 let emitter: Box < dyn Emitter + sync:: Send > = match output {
13971397 config:: ErrorOutputType :: HumanReadable ( kind) => {
13981398 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 ) )
14001400 }
14011401 config:: ErrorOutputType :: Json { pretty, json_rendered } =>
1402- Box :: new ( JsonEmitter :: basic ( pretty, json_rendered) ) ,
1402+ Box :: new ( JsonEmitter :: basic ( pretty, json_rendered, false ) ) ,
14031403 } ;
14041404 let handler = errors:: Handler :: with_emitter ( true , None , emitter) ;
1405- handler. emit ( & MultiSpan :: new ( ) , msg, errors :: Level :: Warning ) ;
1405+ handler. struct_warn ( msg) . emit ( ) ;
14061406}
14071407
14081408pub type CompileResult = Result < ( ) , ErrorReported > ;
0 commit comments