Skip to content

Commit 487e3c5

Browse files
committed
Special case vec macro
1 parent 185e7ca commit 487e3c5

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
@@ -55,9 +55,20 @@ pub use core::prelude::v1::{
5555
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
5656
#[doc(no_inline)]
5757
pub use crate::{
58-
dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local, vec,
58+
dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local,
5959
};
6060

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

0 commit comments

Comments
 (0)