From 6a7e3d23d8e76879383d21223234b95878e58d1e Mon Sep 17 00:00:00 2001 From: Syvraa <66771495+Syvraa@users.noreply.github.com> Date: Thu, 23 Jul 2026 15:33:33 +0200 Subject: [PATCH] remove const hack in alloc --- library/alloc/src/raw_vec/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/library/alloc/src/raw_vec/mod.rs b/library/alloc/src/raw_vec/mod.rs index 843d0346ff5de..5d4ad3ac4bf98 100644 --- a/library/alloc/src/raw_vec/mod.rs +++ b/library/alloc/src/raw_vec/mod.rs @@ -560,11 +560,7 @@ const impl RawVecInner { self.alloc.allocate(new_layout) }; - // FIXME(const-hack): switch back to `map_err` - match memory { - Ok(memory) => Ok(memory), - Err(_) => Err(AllocError { layout: new_layout, non_exhaustive: () }.into()), - } + memory.map_err(const |_| AllocError { layout: new_layout, non_exhaustive: () }.into()) } }