Skip to content

Add Applicability to Fix #4183

@MichaReiser

Description

@MichaReiser

Part of #4181 and depends on #4182

  • Add a new Applicability enum in fix.rs similar to Rome's or Clippy's Applicability enums with three variants:
    • Safe (or Automatic, Always, MachineApplicable?)
    • MaybeIncorrect
    • Unspecified
  • Add the applicability field to Fix
  • Add the new safe and safe_edits constructor functions (identical to unspecified and unspecified_edits)
  • Add the new maybe_incorrect and maybe_incorrect_edits constructor functions (identical to unspecified and unspecified_edits)
  • Mark unspecified and unspecified_edits as deprecated (new lints should use either safe_* or maybe_incorrect_*). Add allow(deprecated)` at the call-sites.
  • Change the Diff implementation to write Suggested Fix for MaybeIncorrect and Unspecified, and Safe fix for Applicability::Safe.

Metadata

Metadata

Assignees

Labels

help wantedContributions especially welcomeinternalAn internal refactor or improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions