Skip to content

"path starts with module" lint fails with rustfix when triggered in macro #51205

Closed
@killercup

Description

@killercup

Thanks to @AdamNiederer opening rust-lang/rustfix#114, we found that it's not possible to fully upgrade faster to the 2018 edition with rustfix.

It fails with "Cannot replace slice of data that was already replaced", because we get the exact same suggestion twice -- because it's part of an expanded macro.

It looks to me like in addition to the changes @alexcrichton introduced in #50665, we'll also need to add a macro check here and here.

There are three solutions. The easy one is to not mark the suggestions as MachineApplicable when the span they come from is in macro. The hard ones are to only trigger this once (or just once as MachineApplicable), or to omit exact duplicates in rustfix (and hope for the best).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.F-rust_2018_preview`#![feature(rust_2018_preview)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-epochWorking group: Epoch (2018) management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions