about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-01-19 04:08:58 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-01-19 04:08:58 +0530
commitf0e8594bce2a17351aabddc3440f047212a464f8 (patch)
tree9515339942b7815fbad2f27d812d9f2b71bc99a8
parentf7913955252baf87a1d0c35d840f24ef32c220da (diff)
parent8a829704cb28544dd13c3de831cf822da17e5bf0 (diff)
downloadrust-f0e8594bce2a17351aabddc3440f047212a464f8.tar.gz
rust-f0e8594bce2a17351aabddc3440f047212a464f8.zip
Rollup merge of #30986 - sliz1:book-macro, r=alexcrichton
Sorry for nitpicking, but I think the example of the expanded macro should be wrapped inside a pair of curly braces to match the macro definition. Also the current example triggers a variable redefinition error.
-rw-r--r--src/doc/book/macros.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/book/macros.md b/src/doc/book/macros.md
index 7c8b74bd649..f5a0cd5e2c6 100644
--- a/src/doc/book/macros.md
+++ b/src/doc/book/macros.md
@@ -285,9 +285,11 @@ This expands to
 
 ```text
 const char *state = "reticulating splines";
-int state = get_log_state();
-if (state > 0) {
-    printf("log(%d): %s\n", state, state);
+{
+    int state = get_log_state();
+    if (state > 0) {
+        printf("log(%d): %s\n", state, state);
+    }
 }
 ```