Skip to content

Existing structured suggestion for (&mut [_])::swap isn't tested #159664

Description

@estebank

The suggestion emitted at

err.span_suggestion(
swap_call.span,
"use `.swap()` to swap elements at the specified indices instead",
format!("{obj_str}.swap({index1_str}, {index2_str})"),
Applicability::MachineApplicable,
);

doesn't seem to have a corresponding .stderr test. Closest I could found is https://github.com/rust-lang/rust/blob/abdb64d4eaa989ff5ef96099f6e1585472de1622/tests/ui/suggestions/suggest-split-at-mut.stderr

We should figure out whether we can trigger it, adjust it if needed or remove it if impossible, add a test and make it verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions