-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Add doc aliases for print macros #79232
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,12 @@ macro_rules! panic { | |
/// io::stdout().flush().unwrap(); | ||
/// ``` | ||
#[macro_export] | ||
#[doc(alias = "echo")] | ||
#[doc(alias = "print")] | ||
#[doc(alias = "printf")] | ||
#[doc(alias = "console.log")] | ||
#[doc(alias = "log")] | ||
#[doc(alias = "puts")] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[allow_internal_unstable(print_internals)] | ||
macro_rules! print { | ||
|
@@ -88,6 +94,12 @@ macro_rules! print { | |
/// println!("format {} arguments", "some"); | ||
/// ``` | ||
#[macro_export] | ||
#[doc(alias = "echo")] | ||
#[doc(alias = "print")] | ||
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. I don't think it's a good idea to add this alias. They'll find the |
||
#[doc(alias = "printf")] | ||
#[doc(alias = "console.log")] | ||
#[doc(alias = "log")] | ||
#[doc(alias = "puts")] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[allow_internal_unstable(print_internals, format_args_nl)] | ||
macro_rules! println { | ||
|
@@ -119,6 +131,12 @@ macro_rules! println { | |
/// eprint!("Error: Could not complete task"); | ||
/// ``` | ||
#[macro_export] | ||
#[doc(alias = "echo")] | ||
#[doc(alias = "print")] | ||
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. Wouldn't add it. |
||
#[doc(alias = "printf")] | ||
#[doc(alias = "console.log")] | ||
#[doc(alias = "log")] | ||
#[doc(alias = "puts")] | ||
#[stable(feature = "eprint", since = "1.19.0")] | ||
#[allow_internal_unstable(print_internals)] | ||
macro_rules! eprint { | ||
|
@@ -147,6 +165,12 @@ macro_rules! eprint { | |
/// eprintln!("Error: Could not complete task"); | ||
/// ``` | ||
#[macro_export] | ||
#[doc(alias = "echo")] | ||
#[doc(alias = "print")] | ||
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. Wouldn't add it. |
||
#[doc(alias = "printf")] | ||
#[doc(alias = "console.log")] | ||
#[doc(alias = "log")] | ||
#[doc(alias = "puts")] | ||
#[stable(feature = "eprint", since = "1.19.0")] | ||
#[allow_internal_unstable(print_internals, format_args_nl)] | ||
macro_rules! eprintln { | ||
|
@@ -280,6 +304,13 @@ macro_rules! eprintln { | |
/// [`debug!`]: https://docs.rs/log/*/log/macro.debug.html | ||
/// [`log`]: https://crates.io/crates/log | ||
#[macro_export] | ||
#[doc(alias = "echo")] | ||
#[doc(alias = "print")] | ||
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. Wouldn't add it. |
||
#[doc(alias = "printf")] | ||
#[doc(alias = "console.log")] | ||
#[doc(alias = "log")] | ||
#[doc(alias = "puts")] | ||
#[doc(alias = "println")] | ||
#[stable(feature = "dbg_macro", since = "1.32.0")] | ||
macro_rules! dbg { | ||
() => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ const QUERY = 'macro:print'; | |
const EXPECTED = { | ||
'others': [ | ||
{ 'path': 'std', 'name': 'print' }, | ||
{ 'path': 'std', 'name': 'dbg' }, | ||
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. Why this change? |
||
{ 'path': 'std', 'name': 'eprint' }, | ||
{ 'path': 'std', 'name': 'println' }, | ||
{ 'path': 'std', 'name': 'eprintln' }, | ||
|
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.
Kinda useless no? :p