File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ use crate::collections::TryReserveErrorKind::*;
1717#[ cfg( test) ]
1818mod 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+
2029enum 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- }
You can’t perform that action at this time.
0 commit comments