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()) } }