Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Various issues with pub(crate) tuple structs containing comments #5011

Copy link
Copy link
Closed
@cormacrelf

Description

@cormacrelf
Issue body actions

These relate specifically to pub(crate) tuple structs. Other vis modifiers are not affected. Only occurs when there is a comment before the first unnamed field.

  • ASlash's comment is deleted
  • AStar gets bonus nonsense
  • BStar is like AStar but on one line
pub(crate) struct ASlash(
    // hello
    i32
);
// output:
// pub(crate) struct ASlash(i32);

pub(crate) struct AStar(
    /* hello */
    i32
);
// output:
// pub(crate) struct AStar(
//     crate) struct AStar(
//     /* hello */
//     i32,
// );

pub(crate) struct BStar(/* hello */ i32);
// output:
// pub(crate) struct BStar(crate) struct BStar(/* hello */ i32);

Tested on rustfmt 1.4.37-stable (c8dfcfe0 2021-09-06)

Similar to #919, but those structs were empty, but these ones have fields.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.