crosvm/msg_socket/msg_on_socket_derive
David Tolnay d32efefb7a 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>
2018-11-21 05:52:46 -08:00
..
Cargo.toml macros: Update syn to 0.15 2018-11-21 05:52:45 -08:00
msg_on_socket_derive.rs macros: Format code inside of quote! invocations 2018-11-21 05:52:46 -08:00