We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c12d76 commit 74f1bfeCopy full SHA for 74f1bfe
library/alloc/src/macros.rs
@@ -109,3 +109,18 @@ macro_rules! format {
109
})
110
}
111
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
+}
0 commit comments