Skip to content

Commit 62a9b9c

Browse files
committed
Move capacity_overflow function to make ui tests change less
Code changes in raw_vec require blessing UI tests every time
1 parent b537b17 commit 62a9b9c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

alloc/src/raw_vec.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ use crate::collections::TryReserveErrorKind::*;
1717
#[cfg(test)]
1818
mod tests;
1919

20+
// One central function responsible for reporting capacity overflows. This'll
21+
// ensure that the code generation related to these panics is minimal as there's
22+
// only one location which panics rather than a bunch throughout the module.
23+
#[cfg(not(no_global_oom_handling))]
24+
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
25+
fn capacity_overflow() -> ! {
26+
panic!("capacity overflow");
27+
}
28+
2029
enum AllocInit {
2130
/// The contents of the new memory are uninitialized.
2231
Uninitialized,
@@ -576,12 +585,3 @@ fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> {
576585
Ok(())
577586
}
578587
}
579-
580-
// One central function responsible for reporting capacity overflows. This'll
581-
// ensure that the code generation related to these panics is minimal as there's
582-
// only one location which panics rather than a bunch throughout the module.
583-
#[cfg(not(no_global_oom_handling))]
584-
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
585-
fn capacity_overflow() -> ! {
586-
panic!("capacity overflow");
587-
}

0 commit comments

Comments
 (0)