This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -961,6 +961,13 @@ impl DiagCtxt {
961
961
DiagnosticBuilder :: new ( self , Level :: Note , msg)
962
962
}
963
963
964
+ /// Construct a builder at the `Bug` level with the `msg`.
965
+ #[ rustc_lint_diagnostics]
966
+ #[ track_caller]
967
+ pub fn struct_bug ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , BugAbort > {
968
+ DiagnosticBuilder :: new ( self , Level :: Bug , msg)
969
+ }
970
+
964
971
#[ rustc_lint_diagnostics]
965
972
#[ track_caller]
966
973
pub fn span_fatal ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
@@ -1104,8 +1111,9 @@ impl DiagCtxt {
1104
1111
self . struct_note ( msg) . emit ( )
1105
1112
}
1106
1113
1114
+ #[ rustc_lint_diagnostics]
1107
1115
pub fn bug ( & self , msg : impl Into < DiagnosticMessage > ) -> ! {
1108
- DiagnosticBuilder :: < BugAbort > :: new ( self , Bug , msg) . emit ( )
1116
+ self . struct_bug ( msg) . emit ( )
1109
1117
}
1110
1118
1111
1119
#[ inline]
Original file line number Diff line number Diff line change @@ -1159,6 +1159,7 @@ impl<'a> ExtCtxt<'a> {
1159
1159
// Fixme: does this result in errors?
1160
1160
self . expansions . clear ( ) ;
1161
1161
}
1162
+ #[ rustc_lint_diagnostics]
1162
1163
pub fn bug ( & self , msg : & ' static str ) -> ! {
1163
1164
self . sess . dcx ( ) . bug ( msg) ;
1164
1165
}
You can’t perform that action at this time.
0 commit comments