Skip to content

Commit 4f2ffbe

Browse files
committed
remove const hack in alloc
1 parent 29e68fe commit 4f2ffbe

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • library/alloc/src/raw_vec

library/alloc/src/raw_vec/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,7 @@ const impl<A: [const] Allocator + [const] Destruct> RawVecInner<A> {
560560
self.alloc.allocate(new_layout)
561561
};
562562

563-
// FIXME(const-hack): switch back to `map_err`
564-
match memory {
565-
Ok(memory) => Ok(memory),
566-
Err(_) => Err(AllocError { layout: new_layout, non_exhaustive: () }.into()),
567-
}
563+
memory.map_err(const |_| AllocError { layout: new_layout, non_exhaustive: () }.into())
568564
}
569565
}
570566

0 commit comments

Comments
 (0)