-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Explicitly export core and std macros #139493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Voultapher
wants to merge
28
commits into
rust-lang:main
Choose a base branch
from
Voultapher:explicitly-export-core-and-std-macros
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+406
−123
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7590745
Explicitly export core and std macros
Voultapher d92b120
Apply review comments
Voultapher c88a7f1
Fix formatting tidy issues
Voultapher a58596f
Special case vec macro
Voultapher 2b7fd0e
Explicitly import format_args_nl
Voultapher b9eb687
Exclude panic and env namespaces from prelude
Voultapher b404cb7
Explicitly use std panic over core panic
Voultapher 792ec20
Remove #[macro_use] std/core from tests
Voultapher bb7aeb5
Update prelude macros
Voultapher cb27a81
Fix feature-gate-format_args_nl UI test
Voultapher 67e0774
Apply review comments
Voultapher 4b29fe2
Fix macro import in alloctests
Voultapher 0f9a11e
Fix rustdoc macro inlining issues
Voultapher 7ecf646
Adapt pretty tests expected outputs
Voultapher d8e5f4e
Silence unproblematic warning
Voultapher 684be2f
Bless UI tests
Voultapher df8f47a
Fix alloctests again
Voultapher 5d3b4e1
Appease clippy
Voultapher 95f9e79
Export new hash_map macro
Voultapher da3dd66
Fix deriving-all-codegen UI test
Voultapher 96fe81c
Bless pretty test output changes
Voultapher c74e610
Adjust println-type test to include prelude items
Voultapher e256c7b
Add ambiguous_panic_imports lint
Voultapher e5c2838
Improve is_issue_147319_hack check
Voultapher 21942cd
Fix rebase issue
Voultapher 6d509ce
Accept inconsistent macro resolution for workaround
Voultapher 2fcaddb
Change ambiguous_panic_imports to report_in_deps false
Voultapher 82371a1
Add test for `panic` with `no_implicit_prelude`
traviscross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,12 +59,29 @@ pub use crate::hash::macros::Hash; | |||||||||||
|
|
||||||||||||
| #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| #[allow(deprecated)] | ||||||||||||
| pub use crate::{ | ||||||||||||
| assert, cfg, column, compile_error, concat, env, file, format_args, | ||||||||||||
| format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, | ||||||||||||
| stringify, trace_macros, | ||||||||||||
| assert, assert_eq, assert_ne, cfg, column, compile_error, concat, debug_assert, debug_assert_eq, debug_assert_ne, file, format_args, include, include_bytes, include_str, line, matches, module_path, option_env, stringify, todo, r#try, unimplemented, unreachable, write, writeln, | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| // These macros needs special handling, so that we don't export it *and* the modules of the same | ||||||||||||
| // name. We only want the macro in the prelude. | ||||||||||||
|
Comment on lines
+67
to
+68
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarification because I was confused at first about what this was doing until I read the comment thread:
Suggested change
|
||||||||||||
| mod ambiguous_macro_only { | ||||||||||||
| #[allow(hidden_glob_reexports)] | ||||||||||||
| mod env {} | ||||||||||||
| #[allow(hidden_glob_reexports)] | ||||||||||||
| mod panic {} | ||||||||||||
| #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] | ||||||||||||
| pub use crate::*; | ||||||||||||
| } | ||||||||||||
| #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use self::ambiguous_macro_only::{env, panic}; | ||||||||||||
|
|
||||||||||||
| #[unstable(feature = "cfg_select", issue = "115585")] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::cfg_select; | ||||||||||||
|
|
||||||||||||
| #[unstable( | ||||||||||||
| feature = "concat_bytes", | ||||||||||||
| issue = "87555", | ||||||||||||
|
|
@@ -73,6 +90,30 @@ pub use crate::{ | |||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::concat_bytes; | ||||||||||||
|
|
||||||||||||
| #[unstable(feature = "const_format_args", issue = "none")] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::const_format_args; | ||||||||||||
|
|
||||||||||||
| #[unstable( | ||||||||||||
| feature = "log_syntax", | ||||||||||||
| issue = "29598", | ||||||||||||
| reason = "`log_syntax!` is not stable enough for use and is subject to change" | ||||||||||||
| )] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::log_syntax; | ||||||||||||
|
|
||||||||||||
| #[unstable(feature = "pattern_type_macro", issue = "123646")] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::pattern_type; | ||||||||||||
|
|
||||||||||||
| #[unstable( | ||||||||||||
| feature = "trace_macros", | ||||||||||||
| issue = "29598", | ||||||||||||
| reason = "`trace_macros` is not stable enough for use and is subject to change" | ||||||||||||
| )] | ||||||||||||
| #[doc(no_inline)] | ||||||||||||
| pub use crate::trace_macros; | ||||||||||||
|
|
||||||||||||
| // Do not `doc(no_inline)` so that they become doc items on their own | ||||||||||||
| // (no public module for them to be re-exported from). | ||||||||||||
| #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] | ||||||||||||
|
|
||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this changed to a closure to avoid evaluating the expression if kind is None?