Files
rust/library/alloc
Jacob Pratt 95bb796b32 Rollup merge of #159864 - zakrad:fix-136797-rc-arc-capacity-overflow, r=JohnTitor
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.
2026-07-31 22:25:10 -04:00
..