@@ -1003,7 +1003,7 @@ impl Handler {
10031003 self . emit_diag_at_span ( Diagnostic :: new_with_code ( Warning ( None ) , Some ( code) , msg) , span) ;
10041004 }
10051005
1006- pub fn span_bug ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
1006+ pub fn span_bug ( & self , span : impl Into < MultiSpan > , msg : impl Into < String > ) -> ! {
10071007 self . inner . borrow_mut ( ) . span_bug ( span, msg)
10081008 }
10091009
@@ -1012,7 +1012,7 @@ impl Handler {
10121012 pub fn delay_span_bug (
10131013 & self ,
10141014 span : impl Into < MultiSpan > ,
1015- msg : impl Into < DiagnosticMessage > ,
1015+ msg : impl Into < String > ,
10161016 ) -> ErrorGuaranteed {
10171017 self . inner . borrow_mut ( ) . delay_span_bug ( span, msg)
10181018 }
@@ -1596,8 +1596,8 @@ impl HandlerInner {
15961596 }
15971597
15981598 #[ track_caller]
1599- fn span_bug ( & mut self , sp : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
1600- self . emit_diag_at_span ( Diagnostic :: new ( Bug , msg) , sp) ;
1599+ fn span_bug ( & mut self , sp : impl Into < MultiSpan > , msg : impl Into < String > ) -> ! {
1600+ self . emit_diag_at_span ( Diagnostic :: new ( Bug , msg. into ( ) ) , sp) ;
16011601 panic:: panic_any ( ExplicitBug ) ;
16021602 }
16031603
@@ -1610,7 +1610,7 @@ impl HandlerInner {
16101610 fn delay_span_bug (
16111611 & mut self ,
16121612 sp : impl Into < MultiSpan > ,
1613- msg : impl Into < DiagnosticMessage > ,
1613+ msg : impl Into < String > ,
16141614 ) -> ErrorGuaranteed {
16151615 // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before
16161616 // incrementing `err_count` by one, so we need to +1 the comparing.
@@ -1619,9 +1619,9 @@ impl HandlerInner {
16191619 self . err_count ( ) + self . lint_err_count + self . delayed_bug_count ( ) + 1 >= c. get ( )
16201620 } ) {
16211621 // FIXME: don't abort here if report_delayed_bugs is off
1622- self . span_bug ( sp, msg) ;
1622+ self . span_bug ( sp, msg. into ( ) ) ;
16231623 }
1624- let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg) ;
1624+ let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg. into ( ) ) ;
16251625 diagnostic. set_span ( sp. into ( ) ) ;
16261626 self . emit_diagnostic ( & mut diagnostic) . unwrap ( )
16271627 }
0 commit comments