Skip to content

Commit 6ff04ff

Browse files
committed
Make builtin macro doc stubs more accurate
See #46242.
1 parent 71da1c2 commit 6ff04ff

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/libstd/macros.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ pub mod builtin {
325325
/// ```
326326
#[stable(feature = "rust1", since = "1.0.0")]
327327
#[macro_export]
328-
macro_rules! format_args { ($fmt:expr, $($args:tt)*) => ({
329-
/* compiler built-in */
330-
}) }
328+
macro_rules! format_args {
329+
($fmt:expr) => ({ /* compiler built-in */ });
330+
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
331+
}
331332

332333
/// Inspect an environment variable at compile time.
333334
///
@@ -348,7 +349,10 @@ pub mod builtin {
348349
/// ```
349350
#[stable(feature = "rust1", since = "1.0.0")]
350351
#[macro_export]
351-
macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }) }
352+
macro_rules! env {
353+
($name:expr) => ({ /* compiler built-in */ });
354+
($name:expr,) => ({ /* compiler built-in */ });
355+
}
352356

353357
/// Optionally inspect an environment variable at compile time.
354358
///
@@ -400,7 +404,8 @@ pub mod builtin {
400404
#[unstable(feature = "concat_idents_macro", issue = "29599")]
401405
#[macro_export]
402406
macro_rules! concat_idents {
403-
($($e:ident),*) => ({ /* compiler built-in */ })
407+
($($e:ident),*) => ({ /* compiler built-in */ });
408+
($($e:ident,)*) => ({ /* compiler built-in */ });
404409
}
405410

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

425433
/// A macro which expands to the line number on which it was invoked.
426434
///

0 commit comments

Comments
 (0)