Skip to content

Commit 3f5e218

Browse files
committed
Give a better explanation for having bug_fmt and span_bug_fmt.
1 parent 635c6d0 commit 3f5e218

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_middle/src/util

1 file changed

+3
-3
lines changed

Diff for: compiler/rustc_middle/src/util/bug.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// These functions are used by macro expansion for bug! and span_bug!
1+
// These functions are used by macro expansion for `bug!` and `span_bug!`.
22

33
use std::fmt;
44
use std::panic::{Location, panic_any};
@@ -8,15 +8,15 @@ use rustc_span::Span;
88

99
use crate::ty::{TyCtxt, tls};
1010

11+
// This wrapper makes for more compact code at callsites than calling `opt_span_buf_fmt` directly.
1112
#[cold]
1213
#[inline(never)]
1314
#[track_caller]
1415
pub fn bug_fmt(args: fmt::Arguments<'_>) -> ! {
15-
// this wrapper mostly exists so I don't have to write a fully
16-
// qualified path of None::<Span> inside the bug!() macro definition
1716
opt_span_bug_fmt(None::<Span>, args, Location::caller());
1817
}
1918

19+
// This wrapper makes for more compact code at callsites than calling `opt_span_buf_fmt` directly.
2020
#[cold]
2121
#[inline(never)]
2222
#[track_caller]

0 commit comments

Comments
 (0)