mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Report "capacity overflow" for oversized Rc<[T]>/Arc<[T]> Fixes rust-lang/rust#136797. Building an Rc<[T]>/Arc<[T]> whose header + payload layout exceeds isize::MAX unwrapped a LayoutError and panicked with "called Result::unwrap() on an Err value: LayoutError". Vec and Box report "capacity overflow" here; this makes Rc/Arc do the same. Used an inline panic!("capacity overflow") rather than raw_vec's capacity_overflow(), since that helper is cfg'd out under no_global_oom_handling while these two layout fns still compile there.