diff options
| author | Michael Lamparski <diagonaldevice@gmail.com> | 2017-11-25 12:06:20 -0500 |
|---|---|---|
| committer | Michael Lamparski <diagonaldevice@gmail.com> | 2017-11-25 12:06:20 -0500 |
| commit | 6ff04ffdfe6e32b864347d721dccd266e7253ec8 (patch) | |
| tree | 9784f4cd2e1b64f9b04682aeb4a98a7f20b0738d /src/libstd | |
| parent | 71da1c21ebc79f19e749344c8b4e2c13f533872e (diff) | |
| download | rust-6ff04ffdfe6e32b864347d721dccd266e7253ec8.tar.gz rust-6ff04ffdfe6e32b864347d721dccd266e7253ec8.zip | |
Make builtin macro doc stubs more accurate
See #46242.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 9d0373404aa..7d62f94056f 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -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. /// @@ -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. /// @@ -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. @@ -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. /// |
