]> git.proxmox.com Git - rustc.git/blobdiff - library/alloc/src/macros.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / library / alloc / src / macros.rs
index d3e9e65c3fe57b493001b6c77c9afc99287ff126..093b02113c3afca9513d5fe2a60335fe7218490a 100644 (file)
@@ -34,7 +34,7 @@
 /// be mindful of side effects.
 ///
 /// [`Vec`]: crate::vec::Vec
-#[cfg(not(test))]
+#[cfg(all(not(no_global_oom_handling), not(test)))]
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_diagnostic_item = "vec_macro"]
@@ -55,7 +55,8 @@ macro_rules! vec {
 // required for this macro definition, is not available. Instead use the
 // `slice::into_vec`  function which is only available with cfg(test)
 // NB see the slice::hack module in slice.rs for more information
-#[cfg(test)]
+#[cfg(all(not(no_global_oom_handling), test))]
+#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
 macro_rules! vec {
     () => (
         $crate::vec::Vec::new()