diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-24 02:21:18 +0200 | 
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-11-16 22:34:57 +0100 | 
| commit | 2bf93bd852f0636eb4d052ee155bdb6cec592c53 (patch) | |
| tree | 2b1afcc6ca36800af099b279acedc25de7d88f28 /compiler/rustc_trait_selection/src/traits/codegen.rs | |
| parent | 3ec6720bf1af8cb9397e6ad48ec300b6a46b25fb (diff) | |
| download | rust-2bf93bd852f0636eb4d052ee155bdb6cec592c53.tar.gz rust-2bf93bd852f0636eb4d052ee155bdb6cec592c53.zip | |
compiler: fold by value
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/codegen.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/codegen.rs | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs index 3cb6ec86261..657d5c123e8 100644 --- a/compiler/rustc_trait_selection/src/traits/codegen.rs +++ b/compiler/rustc_trait_selection/src/traits/codegen.rs @@ -25,7 +25,7 @@ pub fn codegen_fulfill_obligation<'tcx>( (param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>), ) -> Result<ImplSource<'tcx, ()>, ErrorReported> { // Remove any references to regions; this helps improve caching. - let trait_ref = tcx.erase_regions(&trait_ref); + let trait_ref = tcx.erase_regions(trait_ref); // We expect the input to be fully normalized. debug_assert_eq!(trait_ref, tcx.normalize_erasing_regions(param_env, trait_ref)); debug!( @@ -89,7 +89,7 @@ pub fn codegen_fulfill_obligation<'tcx>( debug!("fulfill_obligation: register_predicate_obligation {:?}", predicate); fulfill_cx.register_predicate_obligation(&infcx, predicate); }); - let impl_source = drain_fulfillment_cx_or_panic(&infcx, &mut fulfill_cx, &impl_source); + let impl_source = drain_fulfillment_cx_or_panic(&infcx, &mut fulfill_cx, impl_source); info!("Cache miss: {:?} => {:?}", trait_ref, impl_source); Ok(impl_source) @@ -110,7 +110,7 @@ pub fn codegen_fulfill_obligation<'tcx>( fn drain_fulfillment_cx_or_panic<T>( infcx: &InferCtxt<'_, 'tcx>, fulfill_cx: &mut FulfillmentContext<'tcx>, - result: &T, + result: T, ) -> T where T: TypeFoldable<'tcx>, @@ -128,5 +128,5 @@ where } let result = infcx.resolve_vars_if_possible(result); - infcx.tcx.erase_regions(&result) + infcx.tcx.erase_regions(result) } | 
