@@ -20,7 +20,7 @@ use crate::nodes::{
20
20
} ;
21
21
use crate :: optimizer:: Optimizer ;
22
22
use crate :: property:: { PropertyBuilder , PropertyBuilderAny } ;
23
- use crate :: rules:: RuleWrapper ;
23
+ use crate :: rules:: Rule ;
24
24
25
25
pub type RuleId = usize ;
26
26
@@ -47,7 +47,7 @@ pub struct CascadesOptimizer<T: NodeType, M: Memo<T> = NaiveMemo<T>> {
47
47
explored_group : HashSet < GroupId > ,
48
48
explored_expr : HashSet < ExprId > ,
49
49
fired_rules : HashMap < ExprId , HashSet < RuleId > > ,
50
- rules : Arc < [ Arc < RuleWrapper < T , Self > > ] > ,
50
+ rules : Arc < [ Arc < dyn Rule < T , Self > > ] > ,
51
51
disabled_rules : HashSet < usize > ,
52
52
cost : Arc < dyn CostModel < T , M > > ,
53
53
property_builders : Arc < [ Box < dyn PropertyBuilderAny < T > > ] > ,
@@ -94,15 +94,15 @@ impl Display for PredId {
94
94
95
95
impl < T : NodeType > CascadesOptimizer < T , NaiveMemo < T > > {
96
96
pub fn new (
97
- rules : Vec < Arc < RuleWrapper < T , Self > > > ,
97
+ rules : Vec < Arc < dyn Rule < T , Self > > > ,
98
98
cost : Box < dyn CostModel < T , NaiveMemo < T > > > ,
99
99
property_builders : Vec < Box < dyn PropertyBuilderAny < T > > > ,
100
100
) -> Self {
101
101
Self :: new_with_prop ( rules, cost, property_builders, Default :: default ( ) )
102
102
}
103
103
104
104
pub fn new_with_prop (
105
- rules : Vec < Arc < RuleWrapper < T , Self > > > ,
105
+ rules : Vec < Arc < dyn Rule < T , Self > > > ,
106
106
cost : Box < dyn CostModel < T , NaiveMemo < T > > > ,
107
107
property_builders : Vec < Box < dyn PropertyBuilderAny < T > > > ,
108
108
prop : OptimizerProperties ,
@@ -153,7 +153,7 @@ impl<T: NodeType, M: Memo<T>> CascadesOptimizer<T, M> {
153
153
self . cost . clone ( )
154
154
}
155
155
156
- pub fn rules ( & self ) -> Arc < [ Arc < RuleWrapper < T , Self > > ] > {
156
+ pub fn rules ( & self ) -> Arc < [ Arc < dyn Rule < T , Self > > ] > {
157
157
self . rules . clone ( )
158
158
}
159
159
0 commit comments