Skip to content

[rustfix] Two suggestions applying to the same span cause syntax errors #14699

Open

Description

Problem

rust-lang/rust-clippy#13549

Two suggestions all making changes to the same span have the potential to cause a syntax error.

Steps

  1. cargo new --lib test-crate
  2. Write the following code into src/lib.rs:
struct Foo(i64); 
impl Into<i64> for Foo {
    fn into(self) -> i64 {
        self.0.clone()
    }
}`
  1. cargo clippy --fix

Possible Solution(s)

Making sure that a spans don't overlap each other when having made a suggestion. See more context in the linked issue

Notes

No response

Version

cargo version --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-fixS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions