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