Move capacity_overflow function to make ui tests change less
Code changes in raw_vec require blessing UI tests every time
This commit is contained in:
parent
78fb977d6b
commit
784e6a1e08
@ -17,6 +17,15 @@ use crate::collections::TryReserveErrorKind::*;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
|
// One central function responsible for reporting capacity overflows. This'll
|
||||||
|
// ensure that the code generation related to these panics is minimal as there's
|
||||||
|
// only one location which panics rather than a bunch throughout the module.
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
|
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
|
||||||
|
fn capacity_overflow() -> ! {
|
||||||
|
panic!("capacity overflow");
|
||||||
|
}
|
||||||
|
|
||||||
enum AllocInit {
|
enum AllocInit {
|
||||||
/// The contents of the new memory are uninitialized.
|
/// The contents of the new memory are uninitialized.
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
@ -576,12 +585,3 @@ fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// One central function responsible for reporting capacity overflows. This'll
|
|
||||||
// ensure that the code generation related to these panics is minimal as there's
|
|
||||||
// only one location which panics rather than a bunch throughout the module.
|
|
||||||
#[cfg(not(no_global_oom_handling))]
|
|
||||||
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
|
|
||||||
fn capacity_overflow() -> ! {
|
|
||||||
panic!("capacity overflow");
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
thread 'main' panicked at library/alloc/src/raw_vec.rs:571:5:
|
thread 'main' panicked at library/alloc/src/raw_vec.rs:26:5:
|
||||||
capacity overflow
|
capacity overflow
|
||||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user