summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2018-11-15 15:16:45 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-21 05:52:46 -0800
commitd32efefb7abcbc356eee84342eb11ca8240acda6 (patch)
tree2e9d0caa01a7777db797c187b73742a4d9b64772 /resources
parent1d0b445be2db1dbe9b92ff8b8fa646904ff60fea (diff)
downloadcrosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar.gz
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar.bz2
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar.lz
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar.xz
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.tar.zst
crosvm-d32efefb7abcbc356eee84342eb11ca8240acda6.zip
macros: Format code inside of quote! invocations
Rustfmt currently does not touch the content of macro invocations. Also
it used to have a bug where if it changed indentation of a block of code
containing a multi-line macro invocation then the macro input would not
get correspondingly indented. That bug was visible across some of the
code here.

For example:

    // rustfmt decides to un-indent the surrounding block:
        let data_size_in_bytes = quote!(
            ( #( #field_types::FIELD_WIDTH as usize )+* ) / 8
        );

    // poorly formatted resulting code:
    let data_size_in_bytes = quote!(
            ( #( #field_types::FIELD_WIDTH as usize )+* ) / 8
        );

    // should have been:
    let data_size_in_bytes = quote!(
        ( #( #field_types::FIELD_WIDTH as usize )+* ) / 8
    );

TEST=cargo check crosvm
TEST=cargo test each of the three proc-macro crates
CQ-DEPEND=CL:1338507

Change-Id: Id2d456a8d85d719fbc0a65624f153f0f9df6f500
Reviewed-on: https://chromium-review.googlesource.com/1338508
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Diffstat (limited to 'resources')
0 files changed, 0 insertions, 0 deletions