From bbc230478c5a282a83592830dc338407ed9804eb Mon Sep 17 00:00:00 2001 From: Sven Bartscher Date: Mon, 9 Oct 2023 11:08:48 +0200 Subject: [PATCH] Make BTreeMap::new_in const Closes rust-lang/wg-allocators#118 --- library/alloc/src/collections/btree/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 5481b327d69..4bdd9639557 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -669,7 +669,7 @@ pub fn clear(&mut self) { /// map.insert(1, "a"); /// ``` #[unstable(feature = "btreemap_alloc", issue = "32838")] - pub fn new_in(alloc: A) -> BTreeMap { + pub const fn new_in(alloc: A) -> BTreeMap { BTreeMap { root: None, length: 0, alloc: ManuallyDrop::new(alloc), _marker: PhantomData } } }