Skip to content
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

Make doc stubs for builtin macros reflect existing support for trailing commas #46260

Merged
merged 2 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,10 @@ mod builtin {
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
#[cfg(dox)]
macro_rules! format_args { ($fmt:expr, $($args:tt)*) => ({
/* compiler built-in */
}) }
macro_rules! format_args {
($fmt:expr) => ({ /* compiler built-in */ });
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
}

/// Inspect an environment variable at compile time.
///
Expand All @@ -624,7 +625,10 @@ mod builtin {
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
#[cfg(dox)]
macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }) }
macro_rules! env {
($name:expr) => ({ /* compiler built-in */ });
($name:expr,) => ({ /* compiler built-in */ });
}

/// Optionally inspect an environment variable at compile time.
///
Expand All @@ -645,7 +649,8 @@ mod builtin {
#[macro_export]
#[cfg(dox)]
macro_rules! concat_idents {
($($e:ident),*) => ({ /* compiler built-in */ })
($($e:ident),*) => ({ /* compiler built-in */ });
($($e:ident,)*) => ({ /* compiler built-in */ });
}

/// Concatenates literals into a static string slice.
Expand All @@ -656,7 +661,10 @@ mod builtin {
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
#[cfg(dox)]
macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }) }
macro_rules! concat {
($($e:expr),*) => ({ /* compiler built-in */ });
($($e:expr,)*) => ({ /* compiler built-in */ });
}

/// A macro which expands to the line number on which it was invoked.
///
Expand Down
20 changes: 14 additions & 6 deletions src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ pub mod builtin {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
macro_rules! format_args { ($fmt:expr, $($args:tt)*) => ({
/* compiler built-in */
}) }
macro_rules! format_args {
($fmt:expr) => ({ /* compiler built-in */ });
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
}

/// Inspect an environment variable at compile time.
///
Expand All @@ -348,7 +349,10 @@ pub mod builtin {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }) }
macro_rules! env {
($name:expr) => ({ /* compiler built-in */ });
($name:expr,) => ({ /* compiler built-in */ });
}

/// Optionally inspect an environment variable at compile time.
///
Expand Down Expand Up @@ -400,7 +404,8 @@ pub mod builtin {
#[unstable(feature = "concat_idents_macro", issue = "29599")]
#[macro_export]
macro_rules! concat_idents {
($($e:ident),*) => ({ /* compiler built-in */ })
($($e:ident),*) => ({ /* compiler built-in */ });
($($e:ident,)*) => ({ /* compiler built-in */ });
}

/// Concatenates literals into a static string slice.
Expand All @@ -420,7 +425,10 @@ pub mod builtin {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[macro_export]
macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }) }
macro_rules! concat {
($($e:expr),*) => ({ /* compiler built-in */ });
($($e:expr,)*) => ({ /* compiler built-in */ });
}

/// A macro which expands to the line number on which it was invoked.
///
Expand Down