Skip to content

Commit 6f1e78e

Browse files
committed
fix: hash_map macro location
1 parent 9eda413 commit 6f1e78e

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

library/alloc/src/macros.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,3 @@ macro_rules! format {
109109
})
110110
}
111111
}
112-
113-
#[macro_export]
114-
#[allow_internal_unstable(hint_must_use)]
115-
#[rustc_diagnostic_item = "hash_map_macro"]
116-
macro_rules! hash_map {
117-
() => {{
118-
::std::collections::HashMap::new()
119-
}};
120-
121-
( $( $key:expr => $value:expr ),* $(,)? ) => {{
122-
let mut __map = ::std::collections::HashMap::new();
123-
$( __map.insert($key, $value); )*
124-
__map
125-
}}
126-
}

library/std/src/macros.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,21 @@ macro_rules! dbg {
379379
($($crate::dbg!($val)),+,)
380380
};
381381
}
382+
383+
/// Creates a [`HashMap`]
384+
///
385+
/// [`HashMap`]: crate::collections::HashMap
386+
#[macro_export]
387+
#[allow_internal_unstable(hint_must_use)]
388+
#[rustc_diagnostic_item = "hash_map_macro"]
389+
macro_rules! hash_map {
390+
() => {{
391+
::std::collections::HashMap::new()
392+
}};
393+
394+
( $( $key:expr => $value:expr ),* $(,)? ) => {{
395+
let mut __map = ::std::collections::HashMap::new();
396+
$( __map.insert($key, $value); )*
397+
__map
398+
}}
399+
}

0 commit comments

Comments
 (0)