]> git.lizzy.rs Git - rust.git/commit
Update derive attibute span to start after opening '('
authorYacin Tmimi <ytmimi@horizonmedia.com>
Fri, 24 Sep 2021 02:43:03 +0000 (22:43 -0400)
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>
Wed, 6 Oct 2021 03:29:23 +0000 (22:29 -0500)
commit40f4993c67ff54e413da17496769407ab85f3924
tree6912c4e75df9368305be71bb063b67d4d1a4bf16
parentf0f449d6edda5a40057fc82ea02cc9abeae4d012
Update derive attibute span to start after opening '('

Fixes 4984

When parsing derive attributes we're only concerned about the traits
and comments listed between the opening and closing parentheses.

Derive attribute spans currently start at the '#'.

    Span starts here
    |
    v
    #[derive(...)]

After this update the derive spans start after the opening '('.

    Span starts here
             |
             V
    #[derive(...)]
src/attr.rs
tests/source/issue-4984/minimum_example.rs [new file with mode: 0644]
tests/source/issue-4984/multi_line_derive.rs [new file with mode: 0644]
tests/target/issue-4984/minimum_example.rs [new file with mode: 0644]
tests/target/issue-4984/multi_line_derive.rs [new file with mode: 0644]