From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/semver/src/backport.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vendor/semver/src/backport.rs') diff --git a/vendor/semver/src/backport.rs b/vendor/semver/src/backport.rs index c7751b29f..4b67f56a5 100644 --- a/vendor/semver/src/backport.rs +++ b/vendor/semver/src/backport.rs @@ -22,7 +22,9 @@ pub(crate) mod alloc { pub mod alloc { use std::mem; + use std::process; + #[derive(Copy, Clone)] pub struct Layout { size: usize, } @@ -47,5 +49,12 @@ pub(crate) mod alloc { let len_u16 = (layout.size + 1) / 2; unsafe { Vec::from_raw_parts(ptr as *mut u16, 0, len_u16) }; } + + pub fn handle_alloc_error(_layout: Layout) -> ! { + // This is unreachable because the alloc implementation above never + // returns null; Vec::reserve_exact would already have called std's + // internal handle_alloc_error. + process::abort(); + } } } -- cgit v1.2.3