From a7ad4260fed8ea86356d0d2237c2f391ed120ab0 Mon Sep 17 00:00:00 2001 From: teor Date: Sun, 18 Apr 2021 08:35:24 +1000 Subject: [PATCH] Rust: document rustfmt macro preservation Some common std macros get reformatted. But by default `rustfmt` Is conservative and preserves macro formatting. --- Documentation/rust/coding.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/rust/coding.rst b/Documentation/rust/coding.rst index 46da5fb0974cbe..ec5c57b26a91e6 100644 --- a/Documentation/rust/coding.rst +++ b/Documentation/rust/coding.rst @@ -22,6 +22,9 @@ good news! .. note:: Conventions on comments and documentation are not checked by ``rustfmt``. Thus we still need to take care of those: please see :ref:`Documentation/rust/docs.rst `. + +.. note:: `rustfmt` also preserves formatting inside most macros. So you might + need to manually adjust newlines and indents inside macro invocations. We use the tool's default settings. This means we are following the idiomatic Rust style. For instance, we use 4 spaces for indentation rather than tabs.