@@ -1033,7 +1033,7 @@ impl Handler {
10331033 self . emit_diag_at_span ( Diagnostic :: new_with_code ( Warning ( None ) , Some ( code) , msg) , span) ;
10341034 }
10351035
1036- pub fn span_bug ( & self , span : impl Into < MultiSpan > , msg : impl Into < String > ) -> ! {
1036+ pub fn span_bug ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
10371037 self . inner . borrow_mut ( ) . span_bug ( span, msg)
10381038 }
10391039
@@ -1045,7 +1045,7 @@ impl Handler {
10451045 pub fn span_delayed_bug (
10461046 & self ,
10471047 sp : impl Into < MultiSpan > ,
1048- msg : impl Into < String > ,
1048+ msg : impl Into < DiagnosticMessage > ,
10491049 ) -> ErrorGuaranteed {
10501050 let mut inner = self . inner . borrow_mut ( ) ;
10511051
@@ -1056,10 +1056,10 @@ impl Handler {
10561056 inner. err_count + inner. lint_err_count + inner. delayed_bug_count ( ) + 1 >= c. get ( )
10571057 } ) {
10581058 // FIXME: don't abort here if report_delayed_bugs is off
1059- inner. span_bug ( sp, msg. into ( ) ) ;
1059+ inner. span_bug ( sp, msg) ;
10601060 }
1061- let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg. into ( ) ) ;
1062- diagnostic. set_span ( sp. into ( ) ) ;
1061+ let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg) ;
1062+ diagnostic. set_span ( sp) ;
10631063 inner. emit_diagnostic ( & mut diagnostic) . unwrap ( )
10641064 }
10651065
@@ -1589,8 +1589,8 @@ impl HandlerInner {
15891589 }
15901590
15911591 #[ track_caller]
1592- fn span_bug ( & mut self , sp : impl Into < MultiSpan > , msg : impl Into < String > ) -> ! {
1593- self . emit_diagnostic ( Diagnostic :: new ( Bug , msg. into ( ) ) . set_span ( sp) ) ;
1592+ fn span_bug ( & mut self , sp : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
1593+ self . emit_diagnostic ( Diagnostic :: new ( Bug , msg) . set_span ( sp) ) ;
15941594 panic:: panic_any ( ExplicitBug ) ;
15951595 }
15961596
0 commit comments