f7c4a44149
Resolves 5011 Tuple structs with visibility modifiers and comments before the first field were incorrectly formatted. Comments would duplicate part of the visibility modifier and struct name. When trying to parse the tuple fields the ``items::Context`` searches for the opening '(', but because the visibility modifier introduces another '(' -- for example ``pub(crate)`` -- the parsing gets messed up. Now the span is adjusted to start after the struct identifier, or after any generics. Adjusting the span in this way ensures that the ``items::Contex`` will correctly find the tuple fields.
13 lines
147 B
Rust
13 lines
147 B
Rust
pub(crate) struct ASlash(
|
|
// hello
|
|
i32
|
|
);
|
|
|
|
pub(crate) struct AStar(
|
|
/* hello */
|
|
i32
|
|
);
|
|
|
|
pub(crate) struct BStar(/* hello */ i32);
|
|
|