Skip to content

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

@blyxyas

Description

@blyxyas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-fixS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions