File tree Expand file tree Collapse file tree
src/solve/slg/implementation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,15 +291,15 @@ pub trait Environment<C: Context, I: InferenceContext<C>>: Debug + Clone {
291291
292292pub trait CanonicalExClause < C : Context > : Debug {
293293 /// Extracts the inner normalized substitution.
294- fn inference_normalized_subst ( & self ) -> C :: InferenceNormalizedSubst ;
294+ fn inference_normalized_subst ( & self ) -> & C :: InferenceNormalizedSubst ;
295295}
296296
297297pub trait CanonicalConstrainedSubst < C : Context > : Clone + Debug + Eq + Hash + Ord {
298298 /// True if this solution has no region constraints.
299299 fn empty_constraints ( & self ) -> bool ;
300300
301301 /// Extracts the inner normalized substitution.
302- fn inference_normalized_subst ( & self ) -> C :: InferenceNormalizedSubst ;
302+ fn inference_normalized_subst ( & self ) -> & C :: InferenceNormalizedSubst ;
303303}
304304
305305pub trait DomainGoal < C : Context , I : InferenceContext < C > > : Debug {
@@ -358,6 +358,6 @@ pub trait AnswerStream<C: Context> {
358358 /// if we find any answer for which `test` returns true.
359359 fn any_future_answer (
360360 & mut self ,
361- test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
361+ test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
362362 ) -> bool ;
363363}
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ where
174174
175175 fn any_future_answer (
176176 & mut self ,
177- test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
177+ test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
178178 ) -> bool {
179179 self . forest . any_future_answer ( self . table , self . answer , test)
180180 }
Original file line number Diff line number Diff line change @@ -107,15 +107,15 @@ impl<C: Context> Forest<C> {
107107 & mut self ,
108108 table : TableIndex ,
109109 answer : AnswerIndex ,
110- mut test : impl FnMut ( & mut C :: InferenceNormalizedSubst ) -> bool ,
110+ mut test : impl FnMut ( & C :: InferenceNormalizedSubst ) -> bool ,
111111 ) -> bool {
112112 if let Some ( answer) = self . tables [ table] . answer ( answer) {
113113 info ! ( "answer cached = {:?}" , answer) ;
114- return test ( & mut answer. subst . inference_normalized_subst ( ) ) ;
114+ return test ( answer. subst . inference_normalized_subst ( ) ) ;
115115 }
116116
117117 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 ( ) )
119119 } )
120120 }
121121
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ impl context::Environment<SlgContext, SlgContext> for Arc<Environment> {
240240}
241241
242242impl Substitution {
243- fn may_invalidate ( & mut self , subst : & Canonical < Substitution > ) -> bool {
243+ fn may_invalidate ( & self , subst : & Canonical < Substitution > ) -> bool {
244244 self . parameters
245245 . iter ( )
246246 . zip ( & subst. value . parameters )
@@ -413,8 +413,8 @@ impl context::DomainGoal<SlgContext, SlgContext> for DomainGoal {
413413}
414414
415415impl 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
418418 }
419419}
420420
@@ -423,8 +423,8 @@ impl context::CanonicalConstrainedSubst<SlgContext> for Canonical<ConstrainedSub
423423 self . value . constraints . is_empty ( )
424424 }
425425
426- fn inference_normalized_subst ( & self ) -> Substitution {
427- self . value . subst . clone ( )
426+ fn inference_normalized_subst ( & self ) -> & Substitution {
427+ & self . value . subst
428428 }
429429}
430430
You can’t perform that action at this time.
0 commit comments