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 {
961961 DiagnosticBuilder :: new ( self , Level :: Note , msg)
962962 }
963963
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+
964971 #[ rustc_lint_diagnostics]
965972 #[ track_caller]
966973 pub fn span_fatal ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
@@ -1104,8 +1111,9 @@ impl DiagCtxt {
11041111 self . struct_note ( msg) . emit ( )
11051112 }
11061113
1114+ #[ rustc_lint_diagnostics]
11071115 pub fn bug ( & self , msg : impl Into < DiagnosticMessage > ) -> ! {
1108- DiagnosticBuilder :: < BugAbort > :: new ( self , Bug , msg) . emit ( )
1116+ self . struct_bug ( msg) . emit ( )
11091117 }
11101118
11111119 #[ inline]
Original file line number Diff line number Diff line change @@ -1159,6 +1159,7 @@ impl<'a> ExtCtxt<'a> {
11591159 // Fixme: does this result in errors?
11601160 self . expansions . clear ( ) ;
11611161 }
1162+ #[ rustc_lint_diagnostics]
11621163 pub fn bug ( & self , msg : & ' static str ) -> ! {
11631164 self . sess . dcx ( ) . bug ( msg) ;
11641165 }
You can’t perform that action at this time.
0 commit comments