@@ -1003,7 +1003,7 @@ impl Handler {
1003
1003
self . emit_diag_at_span ( Diagnostic :: new_with_code ( Warning ( None ) , Some ( code) , msg) , span) ;
1004
1004
}
1005
1005
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 > ) -> ! {
1007
1007
self . inner . borrow_mut ( ) . span_bug ( span, msg)
1008
1008
}
1009
1009
@@ -1012,7 +1012,7 @@ impl Handler {
1012
1012
pub fn delay_span_bug (
1013
1013
& self ,
1014
1014
span : impl Into < MultiSpan > ,
1015
- msg : impl Into < DiagnosticMessage > ,
1015
+ msg : impl Into < String > ,
1016
1016
) -> ErrorGuaranteed {
1017
1017
self . inner . borrow_mut ( ) . delay_span_bug ( span, msg)
1018
1018
}
@@ -1596,8 +1596,8 @@ impl HandlerInner {
1596
1596
}
1597
1597
1598
1598
#[ 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) ;
1601
1601
panic:: panic_any ( ExplicitBug ) ;
1602
1602
}
1603
1603
@@ -1610,7 +1610,7 @@ impl HandlerInner {
1610
1610
fn delay_span_bug (
1611
1611
& mut self ,
1612
1612
sp : impl Into < MultiSpan > ,
1613
- msg : impl Into < DiagnosticMessage > ,
1613
+ msg : impl Into < String > ,
1614
1614
) -> ErrorGuaranteed {
1615
1615
// This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before
1616
1616
// incrementing `err_count` by one, so we need to +1 the comparing.
@@ -1619,9 +1619,9 @@ impl HandlerInner {
1619
1619
self . err_count ( ) + self . lint_err_count + self . delayed_bug_count ( ) + 1 >= c. get ( )
1620
1620
} ) {
1621
1621
// FIXME: don't abort here if report_delayed_bugs is off
1622
- self . span_bug ( sp, msg) ;
1622
+ self . span_bug ( sp, msg. into ( ) ) ;
1623
1623
}
1624
- let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg) ;
1624
+ let mut diagnostic = Diagnostic :: new ( Level :: DelayedBug , msg. into ( ) ) ;
1625
1625
diagnostic. set_span ( sp. into ( ) ) ;
1626
1626
self . emit_diagnostic ( & mut diagnostic) . unwrap ( )
1627
1627
}
0 commit comments