Skip to content

Commit 3699f8d

Browse files
committed
Special case vec macro
1 parent 6c9b632 commit 3699f8d

File tree

1 file changed

+12
-1
lines changed
  • library/std/src/prelude

1 file changed

+12
-1
lines changed

library/std/src/prelude/v1.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,20 @@ pub use core::prelude::v1::{
5656
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
5757
#[doc(no_inline)]
5858
pub use crate::{
59-
dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local, vec,
59+
dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local,
6060
};
6161

62+
// The `vec` macro needs special handling, so that we don't export it *and* the `std::vec` module at
63+
// the same time. We only want the macro in the prelude.
64+
mod vec_macro_only {
65+
#[allow(hidden_glob_reexports)]
66+
mod vec {}
67+
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
68+
pub use crate::*;
69+
}
70+
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
71+
pub use self::vec_macro_only::vec;
72+
6273
#[unstable(feature = "cfg_match", issue = "115585")]
6374
#[doc(no_inline)]
6475
pub use core::prelude::v1::cfg_match;

0 commit comments

Comments
 (0)