diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-01-31 09:42:41 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-01-31 16:04:07 +1100 |
| commit | 3f5e21858177714865b67a5f064fdfef07a5cd56 (patch) | |
| tree | 87275a30040e6dc28fbb06210ba317473c71e50d | |
| parent | 635c6d0eacf01c147a7caea27f7f05b75b9932ec (diff) | |
| download | rust-3f5e21858177714865b67a5f064fdfef07a5cd56.tar.gz rust-3f5e21858177714865b67a5f064fdfef07a5cd56.zip | |
Give a better explanation for having `bug_fmt` and `span_bug_fmt`.
| -rw-r--r-- | compiler/rustc_middle/src/util/bug.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/util/bug.rs b/compiler/rustc_middle/src/util/bug.rs index b99336c2c85..7dda68b8393 100644 --- a/compiler/rustc_middle/src/util/bug.rs +++ b/compiler/rustc_middle/src/util/bug.rs @@ -1,4 +1,4 @@ -// These functions are used by macro expansion for bug! and span_bug! +// These functions are used by macro expansion for `bug!` and `span_bug!`. use std::fmt; use std::panic::{Location, panic_any}; @@ -8,15 +8,15 @@ use rustc_span::Span; use crate::ty::{TyCtxt, tls}; +// This wrapper makes for more compact code at callsites than calling `opt_span_buf_fmt` directly. #[cold] #[inline(never)] #[track_caller] pub fn bug_fmt(args: fmt::Arguments<'_>) -> ! { - // this wrapper mostly exists so I don't have to write a fully - // qualified path of None::<Span> inside the bug!() macro definition opt_span_bug_fmt(None::<Span>, args, Location::caller()); } +// This wrapper makes for more compact code at callsites than calling `opt_span_buf_fmt` directly. #[cold] #[inline(never)] #[track_caller] |
