1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! ASTRegApply implementations for basic mutations
//!
//! These implementations enable registry-based execution for mutations
//! defined in ryo-mutations.
//!
//! # Implementation Status
//!
//! | Mutation | V2 Status | Notes |
//! |----------------------------|-----------|-------------------------------------|
//! | AddField/RemoveField | Done | V1/V2 equivalent |
//! | AddDerive/RemoveDerive | Done | V1/V2 equivalent |
//! | AddVariant/RemoveVariant | Done | V1/V2 equivalent |
//! | AddMod/RemoveMod | Done | V1/V2 equivalent |
//! | AddItem/RemoveItem | Done | V2 function API |
//! | AddMethod/RemoveMethod | Done | V2 function API |
//! | CreateMod | Done | V2 function API |
//! | Rename | Done | V1/V2 equivalent |
//! | ChangeVisibility | Done | V1/V2 equivalent |
//! | AddMatchArm/RemoveMatchArm | Done | V2-only (no V1 impl) |
//! | AddStructLiteralField/... | Done | V1/V2 equivalent |
//! | OrganizeImports | Done | V2 via module_items |
//! | AssignOp | Done | Idiom: a = a + b → a += b |
//! | BoolSimplify | Done | Idiom: x == true → x |
//! | ComparisonToMethod | Done | Idiom: s == "" → s.is_empty() |
//! | CollapsibleIf | Done | Idiom: nested if → if a && b |
//! | RedundantClosure | Done | Idiom: \|x\| f(x) → f |
//! | FilterNext | Done | Idiom: .filter().next() → .find() |
//! | MapUnwrapOr | Done | Idiom: .map().unwrap_or() → .map_or() |
//! | CloneOnCopy | Done | Idiom: x.clone() → x (Copy types) |
//! | LoopToIterator | Done | Idiom: for loop → iterator chain |
//! | UnwrapToQuestion | Done | Idiom: .unwrap() → ? |
//! | ManualMap | Done | Idiom: match Some → .map() |
//! | MatchToIfLet | Done | Idiom: match → if let |
//! | IntroduceVariable | Done | Recursive expr replacement |
//! | MergeImplBlocks | N/A | RegistryGenerator auto-merges |
//! | ExtractTrait/InlineTrait | Done | Struct inherent impl ↔ trait |
//! | ReplaceExpr | Done | Recursive expr replacement |
//! | RemoveStatement | Done | Pattern-based stmt removal |
//! | InsertStatement | Done | Position-based stmt insertion |
//! | ReplaceStatement | Done | Stmt-to-stmt replacement |
//! | Duplicate* | Done | Via AddPureItemsMutation |
//! | AddSpec | N/A | Blueprint composition |
//! | MoveItem | N/A | Blueprint composition |
//! | PluginTransform | N/A | WASM runtime, out of scope |
//!
//! # Quality Policy
//!
//! See [`super::ast_reg_apply`] for the V2 implementation quality policy.
//!
//! Key points:
//! - Each implementation must work naturally with ASTRegistry
//! - Do NOT create hacky workarounds to make tests pass
//! - If V2 cannot handle cleanly, evaluate API extensions first
// Tier 2 Idiom mutations
// Implemented
// AddExplicitType / AddMissingFields / FillMatchArms ASTRegApply impls were
// removed in v0.1.0 along with their Mutation structs; type-inference
// infrastructure is required before they can be reintroduced.
// debugger and lock still use todo!() and will be addressed alongside their
// Mutation crate counterparts.
// DbgWrap, InsertInspect, RemoveDebugLogs
// LockScope, UseAtomic, UseRwLock
// Common utilities
pub
// Re-export for convenience (implementations are automatically available via trait)
pub use create_mod_v2;
pub use ;