@@ -1033,7 +1033,7 @@ impl Handler {
1033
1033
self . emit_diag_at_span ( Diagnostic :: new_with_code ( Warning ( None ) , Some ( code) , msg) , span) ;
1034
1034
}
1035
1035
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 > ) -> ! {
1037
1037
self . inner . borrow_mut ( ) . span_bug ( span, msg)
1038
1038
}
1039
1039
@@ -1045,7 +1045,7 @@ impl Handler {
1045
1045
pub fn span_delayed_bug (
1046
1046
& self ,
1047
1047
sp : impl Into < MultiSpan > ,
1048
- msg : impl Into < String > ,
1048
+ msg : impl Into < DiagnosticMessage > ,
1049
1049
) -> ErrorGuaranteed {
1050
1050
let mut inner = self . inner . borrow_mut ( ) ;
1051
1051
@@ -1056,10 +1056,10 @@ impl Handler {
1056
1056
inner. err_count + inner. lint_err_count + inner. delayed_bug_count ( ) + 1 >= c. get ( )
1057
1057
} ) {
1058
1058
// FIXME: don't abort here if report_delayed_bugs is off
1059
- inner. span_bug ( sp, msg. into ( ) ) ;
1059
+ inner. span_bug ( sp, msg) ;
1060
1060
}
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) ;
1063
1063
inner. emit_diagnostic ( & mut diagnostic) . unwrap ( )
1064
1064
}
1065
1065
@@ -1589,8 +1589,8 @@ impl HandlerInner {
1589
1589
}
1590
1590
1591
1591
#[ 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) ) ;
1594
1594
panic:: panic_any ( ExplicitBug ) ;
1595
1595
}
1596
1596
0 commit comments