File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1791,7 +1791,7 @@ impl Type {
1791
1791
. build ( ) ;
1792
1792
1793
1793
let goal = Canonical {
1794
- value : hir_ty:: InEnvironment :: new ( self . env . env . clone ( ) , trait_ref. cast ( & Interner ) ) ,
1794
+ value : hir_ty:: InEnvironment :: new ( & self . env . env , trait_ref. cast ( & Interner ) ) ,
1795
1795
binders : CanonicalVarKinds :: empty ( & Interner ) ,
1796
1796
} ;
1797
1797
@@ -1810,7 +1810,7 @@ impl Type {
1810
1810
. build ( ) ;
1811
1811
let goal = hir_ty:: make_canonical (
1812
1812
InEnvironment :: new (
1813
- self . env . env . clone ( ) ,
1813
+ & self . env . env ,
1814
1814
AliasEq {
1815
1815
alias : AliasTy :: Projection ( projection) ,
1816
1816
ty : TyKind :: BoundVar ( BoundVar :: new ( DebruijnIndex :: INNERMOST , 0 ) )
Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ impl<'a> InferenceContext<'a> {
336
336
self . last_obligations_check = Some ( self . table . revision ) ;
337
337
let obligations = mem:: replace ( & mut self . obligations , Vec :: new ( ) ) ;
338
338
for obligation in obligations {
339
- let in_env = InEnvironment :: new ( self . trait_env . env . clone ( ) , obligation. clone ( ) ) ;
339
+ let in_env = InEnvironment :: new ( & self . trait_env . env , obligation. clone ( ) ) ;
340
340
let canonicalized = self . canonicalizer ( ) . canonicalize_obligation ( in_env) ;
341
341
let solution =
342
342
self . db . trait_solve ( self . resolver . krate ( ) . unwrap ( ) , canonicalized. value . clone ( ) ) ;
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ impl<'a> InferenceContext<'a> {
139
139
b. push ( from_ty. clone ( ) ) . push ( to_ty. clone ( ) ) . build ( )
140
140
} ;
141
141
142
- let goal = InEnvironment :: new ( self . trait_env . env . clone ( ) , trait_ref. cast ( & Interner ) ) ;
142
+ let goal = InEnvironment :: new ( & self . trait_env . env , trait_ref. cast ( & Interner ) ) ;
143
143
144
144
let canonicalizer = self . canonicalizer ( ) ;
145
145
let canonicalized = canonicalizer. canonicalize_obligation ( goal) ;
Original file line number Diff line number Diff line change @@ -845,7 +845,7 @@ fn generic_implements_goal(
845
845
let obligation = trait_ref. cast ( & Interner ) ;
846
846
Canonical {
847
847
binders : CanonicalVarKinds :: from_iter ( & Interner , kinds) ,
848
- value : InEnvironment :: new ( env. env . clone ( ) , obligation) ,
848
+ value : InEnvironment :: new ( & env. env , obligation) ,
849
849
}
850
850
}
851
851
Original file line number Diff line number Diff line change @@ -470,8 +470,8 @@ pub struct InEnvironment<T> {
470
470
}
471
471
472
472
impl < T > InEnvironment < T > {
473
- pub fn new ( environment : chalk_ir:: Environment < Interner > , value : T ) -> InEnvironment < T > {
474
- InEnvironment { environment, goal : value }
473
+ pub fn new ( environment : & chalk_ir:: Environment < Interner > , value : T ) -> InEnvironment < T > {
474
+ InEnvironment { environment : environment . clone ( ) , goal : value }
475
475
}
476
476
}
477
477
You can’t perform that action at this time.
0 commit comments