rust/tests/source/issue-4984/multi_line_derive.rs
Yacin Tmimi 40f4993c67 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(...)]
2021-10-05 22:29:23 -05:00

21 lines
376 B
Rust

#[derive(
/* ---------- Some really important comment that just had to go inside the derive --------- */
Debug, Clone, Eq, PartialEq,
)]
struct Foo {
a: i32,
b: T,
}
#[derive(
/*
Some really important comment that just had to go inside the derive.
Also had to be put over multiple lines
*/
Debug, Clone, Eq, PartialEq,
)]
struct Bar {
a: i32,
b: T,
}