Skip to content

[Easy] cargo collect-metadata interprets anything behind a comma as a new lint #12042

Closed
@blyxyas

Description

@blyxyas

Summary

While reviewing #10283, we stumbled across this bug that added or as a new lint to the "Affected Lints" list.

This happened because there was an "[...], or [...]" in the configuration option documentation.

Reproducer

I tried this code:

    /// Lint: PUB_UNDERSCORE_FIELDS
    ///
    /// Lint "public" fields in a struct that are prefixed with an underscore based on their
    /// exported visibility, or whether they are marked as "pub".
    (pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PublicallyExported),

I expected to see this happen (in the config's documentation):

Affected lints:

Instead, this happened:

Affected lints:


This was fixed by changing that comma to a semi-colon

Version

[...]

Additional Labels

No response

Metadata

Metadata

Assignees

Labels

A-documentationArea: Adding or improving documentationA-uiArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions