Skip to content

Commit b7c6dc6

Browse files
committed
update the builtin macro doc stubs
1 parent 1137fb1 commit b7c6dc6

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

src/libcore/macros.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,10 @@ mod builtin {
616616
#[stable(feature = "compile_error_macro", since = "1.20.0")]
617617
#[macro_export]
618618
#[cfg(dox)]
619-
macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }) }
619+
macro_rules! compile_error {
620+
($msg:expr) => ({ /* compiler built-in */ });
621+
($msg:expr,) => ({ /* compiler built-in */ });
622+
}
620623

621624
/// The core macro for formatted string creation & output.
622625
///
@@ -652,7 +655,10 @@ mod builtin {
652655
#[stable(feature = "rust1", since = "1.0.0")]
653656
#[macro_export]
654657
#[cfg(dox)]
655-
macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }) }
658+
macro_rules! option_env {
659+
($name:expr) => ({ /* compiler built-in */ });
660+
($name:expr,) => ({ /* compiler built-in */ });
661+
}
656662

657663
/// Concatenate identifiers into one identifier.
658664
///
@@ -728,7 +734,10 @@ mod builtin {
728734
#[stable(feature = "rust1", since = "1.0.0")]
729735
#[macro_export]
730736
#[cfg(dox)]
731-
macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }) }
737+
macro_rules! include_str {
738+
($file:expr) => ({ /* compiler built-in */ });
739+
($file:expr,) => ({ /* compiler built-in */ });
740+
}
732741

733742
/// Includes a file as a reference to a byte array.
734743
///
@@ -738,7 +747,10 @@ mod builtin {
738747
#[stable(feature = "rust1", since = "1.0.0")]
739748
#[macro_export]
740749
#[cfg(dox)]
741-
macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }) }
750+
macro_rules! include_bytes {
751+
($file:expr) => ({ /* compiler built-in */ });
752+
($file:expr,) => ({ /* compiler built-in */ });
753+
}
742754

743755
/// Expands to a string that represents the current module path.
744756
///
@@ -768,5 +780,8 @@ mod builtin {
768780
#[stable(feature = "rust1", since = "1.0.0")]
769781
#[macro_export]
770782
#[cfg(dox)]
771-
macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }) }
783+
macro_rules! include {
784+
($file:expr) => ({ /* compiler built-in */ });
785+
($file:expr,) => ({ /* compiler built-in */ });
786+
}
772787
}

src/libstd/macros.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ pub mod builtin {
315315
/// ```
316316
#[stable(feature = "compile_error_macro", since = "1.20.0")]
317317
#[macro_export]
318-
macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }) }
318+
macro_rules! compile_error {
319+
($msg:expr) => ({ /* compiler built-in */ });
320+
($msg:expr,) => ({ /* compiler built-in */ });
321+
}
319322

320323
/// The core macro for formatted string creation & output.
321324
///
@@ -403,7 +406,10 @@ pub mod builtin {
403406
/// ```
404407
#[stable(feature = "rust1", since = "1.0.0")]
405408
#[macro_export]
406-
macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }) }
409+
macro_rules! option_env {
410+
($name:expr) => ({ /* compiler built-in */ });
411+
($name:expr,) => ({ /* compiler built-in */ });
412+
}
407413

408414
/// Concatenate identifiers into one identifier.
409415
///
@@ -583,7 +589,10 @@ pub mod builtin {
583589
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
584590
#[stable(feature = "rust1", since = "1.0.0")]
585591
#[macro_export]
586-
macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }) }
592+
macro_rules! include_str {
593+
($file:expr) => ({ /* compiler built-in */ });
594+
($file:expr,) => ({ /* compiler built-in */ });
595+
}
587596

588597
/// Includes a file as a reference to a byte array.
589598
///
@@ -617,7 +626,10 @@ pub mod builtin {
617626
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
618627
#[stable(feature = "rust1", since = "1.0.0")]
619628
#[macro_export]
620-
macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }) }
629+
macro_rules! include_bytes {
630+
($file:expr) => ({ /* compiler built-in */ });
631+
($file:expr,) => ({ /* compiler built-in */ });
632+
}
621633

622634
/// Expands to a string that represents the current module path.
623635
///
@@ -703,7 +715,10 @@ pub mod builtin {
703715
/// "🙈🙊🙉🙈🙊🙉".
704716
#[stable(feature = "rust1", since = "1.0.0")]
705717
#[macro_export]
706-
macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }) }
718+
macro_rules! include {
719+
($file:expr) => ({ /* compiler built-in */ });
720+
($file:expr,) => ({ /* compiler built-in */ });
721+
}
707722
}
708723

709724
/// A macro for defining #[cfg] if-else statements.

0 commit comments

Comments
 (0)