@@ -43,15 +43,44 @@ pub use crate::option::Option::{self, None, Some};
4343#[ doc( no_inline) ]
4444pub use crate :: result:: Result :: { self , Err , Ok } ;
4545
46- // Re-exported built-in macros
46+ // Re-exported built-in macros and traits
4747#[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
4848#[ doc( no_inline) ]
49+ #[ allow( deprecated) ]
4950pub use core:: prelude:: v1:: {
50- assert, cfg, column, compile_error, concat, env, file, format_args,
51- format_args_nl , include , include_bytes , include_str , line , log_syntax , module_path , option_env ,
52- stringify , trace_macros , Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ,
51+ assert, assert_eq , assert_ne , cfg, column, compile_error, concat, debug_assert , debug_assert_eq , debug_assert_ne , env, file, format_args, include , include_bytes , include_str , line , matches ,
52+ module_path , option_env , stringify , todo , r#try , unimplemented , unreachable , write ,
53+ writeln , Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ,
5354} ;
5455
56+ #[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
57+ #[ doc( no_inline) ]
58+ pub use crate :: {
59+ dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local, hash_map
60+ } ;
61+
62+ // These macros needs special handling, so that we don't export it *and* the modules of the same
63+ // name. We only want the macro in the prelude.
64+ mod ambiguous_macro_only_std {
65+ #[ allow( hidden_glob_reexports) ]
66+ mod vec { }
67+ #[ allow( hidden_glob_reexports) ]
68+ mod panic { }
69+ // Building std without the allow exported_private_dependencies will create warnings, but then
70+ // clippy claims its a useless_attribute. So silence both.
71+ #[ allow( clippy:: useless_attribute) ]
72+ #[ allow( exported_private_dependencies) ]
73+ #[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
74+ pub use crate :: * ;
75+ }
76+ #[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
77+ #[ doc( no_inline) ]
78+ pub use self :: ambiguous_macro_only_std:: { vec, panic} ;
79+
80+ #[ unstable( feature = "cfg_select" , issue = "115585" ) ]
81+ #[ doc( no_inline) ]
82+ pub use core:: prelude:: v1:: cfg_select;
83+
5584#[ unstable(
5685 feature = "concat_bytes" ,
5786 issue = "87555" ,
@@ -60,6 +89,26 @@ pub use core::prelude::v1::{
6089#[ doc( no_inline) ]
6190pub use core:: prelude:: v1:: concat_bytes;
6291
92+ #[ unstable( feature = "const_format_args" , issue = "none" ) ]
93+ #[ doc( no_inline) ]
94+ pub use core:: prelude:: v1:: const_format_args;
95+
96+ #[ unstable(
97+ feature = "log_syntax" ,
98+ issue = "29598" ,
99+ reason = "`log_syntax!` is not stable enough for use and is subject to change"
100+ ) ]
101+ #[ doc( no_inline) ]
102+ pub use core:: prelude:: v1:: log_syntax;
103+
104+ #[ unstable(
105+ feature = "trace_macros" ,
106+ issue = "29598" ,
107+ reason = "`trace_macros` is not stable enough for use and is subject to change"
108+ ) ]
109+ #[ doc( no_inline) ]
110+ pub use core:: prelude:: v1:: trace_macros;
111+
63112// Do not `doc(no_inline)` so that they become doc items on their own
64113// (no public module for them to be re-exported from).
65114#[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
0 commit comments