Skip to content

Commit 4c053db

Browse files
committed
Auto merge of #45451 - durka:patch-45, r=steveklabnik
fix stringify docs Update `stringify!` docs to show actual accepted syntax. Reported [on reddit](https://www.reddit.com/r/rust/comments/76o8rh/hey_rustaceans_got_an_easy_question_ask_here/dopzwys/).
2 parents 8493813 + 365eafb commit 4c053db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libcore/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,15 +682,15 @@ mod builtin {
682682
#[cfg(dox)]
683683
macro_rules! file { () => ({ /* compiler built-in */ }) }
684684

685-
/// A macro which stringifies its argument.
685+
/// A macro which stringifies its arguments.
686686
///
687687
/// For more information, see the documentation for [`std::stringify!`].
688688
///
689689
/// [`std::stringify!`]: ../std/macro.stringify.html
690690
#[stable(feature = "rust1", since = "1.0.0")]
691691
#[macro_export]
692692
#[cfg(dox)]
693-
macro_rules! stringify { ($t:tt) => ({ /* compiler built-in */ }) }
693+
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
694694

695695
/// Includes a utf8-encoded file as a string.
696696
///

src/libstd/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ pub mod builtin {
490490
#[macro_export]
491491
macro_rules! file { () => ({ /* compiler built-in */ }) }
492492

493-
/// A macro which stringifies its argument.
493+
/// A macro which stringifies its arguments.
494494
///
495495
/// This macro will yield an expression of type `&'static str` which is the
496496
/// stringification of all the tokens passed to the macro. No restrictions
@@ -507,7 +507,7 @@ pub mod builtin {
507507
/// ```
508508
#[stable(feature = "rust1", since = "1.0.0")]
509509
#[macro_export]
510-
macro_rules! stringify { ($t:tt) => ({ /* compiler built-in */ }) }
510+
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
511511

512512
/// Includes a utf8-encoded file as a string.
513513
///

0 commit comments

Comments
 (0)