Skip to content

Commit 2e24adf

Browse files
committed
std: comment about OOM & allocs in begin_unwind_fmt.
Follow-up to #11841 which added this function.
1 parent 4176343 commit 2e24adf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstd/rt/unwind.rs

+4
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ pub fn begin_unwind_raw(msg: *u8, file: *u8, line: uint) -> ! {
391391
/// the actual formatting into this shared place.
392392
#[inline(never)] #[cold]
393393
pub fn begin_unwind_fmt(msg: &fmt::Arguments, file: &'static str, line: uint) -> ! {
394+
// We do two allocations here, unfortunately. But (a) they're
395+
// required with the current scheme, and (b) we don't handle
396+
// failure + OOM properly anyway (see comment in begin_unwind
397+
// below).
394398
begin_unwind_inner(~fmt::format(msg), file, line)
395399
}
396400

0 commit comments

Comments
 (0)