File tree 4 files changed +12
-12
lines changed
src/solve/slg/implementation
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -291,15 +291,15 @@ pub trait Environment<C: Context, I: InferenceContext<C>>: Debug + Clone {
291
291
292
292
pub trait CanonicalExClause < C : Context > : Debug {
293
293
/// Extracts the inner normalized substitution.
294
- fn inference_normalized_subst ( & self ) -> C :: InferenceNormalizedSubst ;
294
+ fn inference_normalized_subst ( & self ) -> & C :: InferenceNormalizedSubst ;
295
295
}
296
296
297
297
pub trait CanonicalConstrainedSubst < C : Context > : Clone + Debug + Eq + Hash + Ord {
298
298
/// True if this solution has no region constraints.
299
299
fn empty_constraints ( & self ) -> bool ;
300
300
301
301
/// Extracts the inner normalized substitution.
302
- fn inference_normalized_subst ( & self ) -> C :: InferenceNormalizedSubst ;
302
+ fn inference_normalized_subst ( & self ) -> & C :: InferenceNormalizedSubst ;
303
303
}
304
304
305
305
pub trait DomainGoal < C : Context , I : InferenceContext < C > > : Debug {
@@ -358,6 +358,6 @@ pub trait AnswerStream<C: Context> {
358
358
/// if we find any answer for which `test` returns true.
359
359
fn any_future_answer (
360
360
& mut self ,
361
- test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
361
+ test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
362
362
) -> bool ;
363
363
}
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ where
174
174
175
175
fn any_future_answer (
176
176
& mut self ,
177
- test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
177
+ test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
178
178
) -> bool {
179
179
self . forest . any_future_answer ( self . table , self . answer , test)
180
180
}
Original file line number Diff line number Diff line change @@ -107,15 +107,15 @@ impl<C: Context> Forest<C> {
107
107
& mut self ,
108
108
table : TableIndex ,
109
109
answer : AnswerIndex ,
110
- mut test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
110
+ mut test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
111
111
) -> bool {
112
112
if let Some ( answer) = self . tables [ table] . answer ( answer) {
113
113
info ! ( "answer cached = {:?}" , answer) ;
114
- return test ( & mut answer. subst . inference_normalized_subst ( ) ) ;
114
+ return test ( answer. subst . inference_normalized_subst ( ) ) ;
115
115
}
116
116
117
117
self . tables [ table] . strands_mut ( ) . any ( |strand| {
118
- test ( & mut strand. canonical_ex_clause . inference_normalized_subst ( ) )
118
+ test ( strand. canonical_ex_clause . inference_normalized_subst ( ) )
119
119
} )
120
120
}
121
121
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ impl context::Environment<SlgContext, SlgContext> for Arc<Environment> {
240
240
}
241
241
242
242
impl Substitution {
243
- fn may_invalidate ( & mut self , subst : & Canonical < Substitution > ) -> bool {
243
+ fn may_invalidate ( & self , subst : & Canonical < Substitution > ) -> bool {
244
244
self . parameters
245
245
. iter ( )
246
246
. zip ( & subst. value . parameters )
@@ -413,8 +413,8 @@ impl context::DomainGoal<SlgContext, SlgContext> for DomainGoal {
413
413
}
414
414
415
415
impl context:: CanonicalExClause < SlgContext > for Canonical < ExClause < SlgContext , SlgContext > > {
416
- fn inference_normalized_subst ( & self ) -> Substitution {
417
- self . value . subst . clone ( )
416
+ fn inference_normalized_subst ( & self ) -> & Substitution {
417
+ & self . value . subst
418
418
}
419
419
}
420
420
@@ -423,8 +423,8 @@ impl context::CanonicalConstrainedSubst<SlgContext> for Canonical<ConstrainedSub
423
423
self . value . constraints . is_empty ( )
424
424
}
425
425
426
- fn inference_normalized_subst ( & self ) -> Substitution {
427
- self . value . subst . clone ( )
426
+ fn inference_normalized_subst ( & self ) -> & Substitution {
427
+ & self . value . subst
428
428
}
429
429
}
430
430
You can’t perform that action at this time.
0 commit comments